Lab 3 Solution

$29.99 $18.99

Introduction: Last week’s lab introduced us to conditional execution, where code may or may not run based on some condition. Similarly, many times when we write code we will want some statement to be executed many times. Rather than re-writing the statements that we want to be repeated, we can employ the techniques of ​Looping…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

Rate this product

Introduction:

Last week’s lab introduced us to conditional execution, where code may or may not run based on some condition. Similarly, many times when we write code we will want some statement to be executed many times. Rather than re-writing the statements that we want to be repeated, we can employ the techniques of Looping to have the program repeat those statements as many times as needed..There are three types of loops provided in C++:

while decides whether to continue looping before executing do… while decides whether to continue looping after executing for executes a fixed number of times

The purpose of this lab is to introduce you to Looping.

Directions:

1- Launch Code::Blocks and start a new file. Name it your_last_name_lab3.cpp.

2-Include the standard header for this lab:

//Your Name

//CS1428

//Lab 3

3- Include the iostream standard library and start your main function:

#include <iostream>

using namespace std;

int main() {

4- Practice using each of the 3 kinds of loops by copying the following code:

int myCount = 0;

bool myCondition = true;

6- Your client requires a simple program which can classify triangles. You should write a small segment of code which will repeatedly take input from a user (i.e. use a cinstatement) for the lengths of the three legs of a triangle and then print acute, right, obtuse, or invalid based on the following relationships:

9- Save you work. Build and Run your file. Fix any errors. Your output should look something like this:

10- Submit your .cpp file through TRACS as an attachment.