Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ Program ASSIGNMENT 2 – Write all the code… Write a program from scratch, tha

ID: 3869826 • Letter: C

Question

c++

Program ASSIGNMENT 2 – Write all the code…

Write a program from scratch, that asks a person how tall they are.

“How many feet and how many inches are you”

“How tall are you: “

Feet: 5 ß they enter 5

Inches: 4 ß they enter 4

Write code that calculates how many total inches high they are. ( Hint: there 12 inches to a foot )

Output the results.

Example output: “You are 64 inches high”

Program ASSIGNMENT 3 – Write all the code…

Write a program from scratch given these declarations and assignments: double a = 18, b = 6, c = 3, and that calculates the answers for:

cout << a + b / c;

cout << ( a + b ) / c;

cout << a + ( b / c );

Explain the difference or similarity in the answers.

Output the results

Explanation / Answer

#include <iostream>
using namespace std;

int main () {// start program
int feet, inches, height;
cout<<"Enter Feet: ";
cin >> feet;
cout<<"Enter Inches: ";
cin >> inches;
height = feet * 12 + inches;
cout<<"You are "<<height<<" inches high"<<endl;
return 0;

} // end of program

Output:

ASSIGNMENT 3

Answer:

cout << a + b / c; will print 20

18 + 6 /3 = 18 + 2 = 20

cout << ( a + b ) / c; will print 8

(18 + 6) / 3 = 24 / 3 = 8

cout << a + ( b / c ); will print 20

18 + 6 /3 = 18 + 2 = 20

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote