CCC+ Assignment

The picture of lego of Dallas College - Richland campus

COSC 1436 – LAB2

Contents

TITLE. 1

TIME TO COMPLETE. 1

HOW TO DO  EACH PART. 1

Step1: 1

Step2: 1

Step3: 1

Step4: 1

Step5: 2

LAB2 – PART1 REQUIREMENT.. 2

LAB2 – PART2 REQUIREMENT. 2

HOW TO TURN IN THE LAB. 3

HOW TO GRADE THE LAB. 3

TITLE: CalculateSaving Money and BMI Manage Weight

TIME TO COMPLETE: two weeks

HOW TO DO  EACH PART

Remember to do the lab with the following:

*If you need help about the C++ syntax to write the code, read the instruction in the folder “Skills Required”

*From now and on yourLastName will be changed to your last name

*Your program should change Smith to your last name

*Change James Smith to your full name

*write the file name as the first comment line at the top of program

*After running your program, take the picture of the output window as below from your program with your name on and paste the picture at the bottom of the document having pseudo-code to turn in

Step1:

Read the requirement; write in English the pseudo-code in a word document by listing the step by step what you suppose to do in main() and then save it with the name as Lab2_pseudoCode_yourLastName

(store pseudo-code and output pictures of both part 1 and part 2)

Step2:

Start Virtual Studio C++, create the project à  write the project name

                        For Part 1: FA2021_LAB2PART1_yourLastName

                        For Part 2: FA2021_LAB2PART2_yourLastName

Add .cpp file

                        For Part 1: FA2021_SavingMoney_yourLastName.cpp

                        For Part 2: FA2021_BMI_ManageWeight_yourLastName.cpp

After adding the cpp file, you have an empty window coming up, type the following template of a C++ program in:

//File name should be written here as comment line

#include <iostream>

using namespace std;

int main()

{

         //add the code here below this line

        …..

        system(“pause”); //This will pause the output to read

        return 0;

}

Step3:

Then follow the step by step in the pseudo-code, type the C++ code in after the line “//add the code here below this line”

Step4:

Compile and run the program

Step5:

Debug if there are any errors until compile successfully

LAB2 – PART1 REQUIREMENT

Using C++, provide the application that helps users to calculate the money returned after a year if users put their money to a saving account.

The application should display the message to ask then read three information of the users from the keyboard about: customer name (string),  the amount of money (float) that the customers want to put in to open the saving account and the saving interest rate (float, 0.49 for 0.49%).

After that, the application will display the output as below. The output should be formatted in columns with decimal numbers with 2 decimal digits.

The output lines should be separated from the input therefore, all the lines written to read input are not counted in the output.

FA2021_SavingMoney_Smith.cpp

Fall 2021 Semester – JAMES SMITH

————————————————————————-

Name of Bank Customer:                       Mary Lane

Amount of money in Saving account:       15750.00

Interest Rate:                                                    0.05%

————————————————————————-

Total money at the end of year round:       15757.88

The output window is as below:

The picture shows the output of Part 2, the money returned after one year

The formula to calculate is:

Interest amount after one year = amount of money * interest rate

Total money after a year = amount of money + interest amount

LAB2 – PART2 REQUIREMENT

Body Mass Index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. To adult men and women, it is normal if their BMI in the range 18.5 – 24.9

If BMI < 18.5, the person is underweight. If the BMI is in the range 25 to 29.9, the person is overweight. If BMI>= 30, the person is obesity.

Using C++ to provide the application to help users to know their weight would be if users want to have BMI is a number in the good range.

The program first displays the message to ask for input and reads the information of the users about name (string), the height (float, in inches) and the value of BMI the users want to get. Then, display the output if the input is Mary Lane for name, 58 for height and 22.5 for BMI.

The output should be formatted in columns with decimal numbers with 2 decimal digits.

The output should be separated from the input.

————————————————————

FA2021_BMI_ManageWeight_Smith.cpp

Fall 2021 Semester – JAMES SMITH

Standard BMI:                        18.5 – 24.9

———————————————————–

Name:                                     Mary Lane

Height (inches):                                   58

Expected BMI:                                22.50

———————————————————-

Your weight (pounds) should be: 107.67

The output window should be:

The picture shows the output of part 2 about the weight is needed for expected BMI

The formula to calculate weight:

            weight = BMI * (height * height) / 703

HOW TO TURN IN THE LAB

You turn in the following files:

pseudoCode and pictures of the output windows of both parts

FA2021_SavingMoney_yourLastName.cpp

FA2021_LAB2PART1_yourLastName.exe

FA2021_BMI_ManageWeight_yourLastName.cpp

FA2021_LAB2PART2_LastName.exe

IF YOU GET ANY PROBLEM TO SUBMIT FILE .class, YOU CAN SUBMIT ALL PROJECT

INTO ONE FILE .zip or .rar

HOW TO GRADE THE LAB

ITEMSSCORE
TURN IN THE LAB ON TIME3
Part 1: Name of project and source file correct0.5
Part 1: pseudo-code with the output window pictures2
Part 1: Define one string variable, read input full name1
Part 1: Define variables, read input for money, interest rate1
Part 1: calculate the result correctly2
Part 1: output 8 lines in 2 columns, change James Smith to your name, separate the output from input; decimal numbers have 2 decimal digits3
Part 1: compile without errors, qualified the requirements3
Part 1: write comment1
Part 2: Name of project and source file correct0.5
Part 2: pseudo-code with the output window pictures2
Part 2: Define string variable, read input full name1
Part 2: Define variables to read height, BMI1
Part 2: calculate weight correctly in decimal number2
Part 2: Display 10 lines in columns, change to your name, second information is aligned to right, numbers have 2 decimal digits3
Part 2: write the comments1
Part 2: compile success – qualify the requirement – code indented easy to read3
Total lab2 scores30