Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) Develop a flowchart and then write a C++ program to solve the following program. Upon execution of the program, your name will be displayed,

(a) Develop a flowchart and then write a C++ program to solve the following program. Upon execution of the program, your name will be displayed, properly centered. This is not a block letters as in H2. The name is your real name like John Doe. Below your name, you will write Chapter 4 Selection Structures. You will be using the logical operators, relational operators and selection structures for this assignment.

(b) The program will then prompt the user for two integer inputs and the program will then compute the sum and the product of the two numbers and produce the results of both operations with appropriate labels. See sample output for the addition operation below. The output assumes a = 5, and b = 10. Sum of a and b is equal to a + b or 5 + 10 and the result is 15. If the result is true, display true. If it is not true, display false. The format for the product of the two numbers is the same.

(c)The program will then use the same two integer numbers and perform the following operations. The program displays the relations between the two numbers for the following relational operators: >=, ==, < Each of these operators requires two operands: use the first integer number as the first operand and the second integer number as the second operand. See sample of output desired below. a < b is 5 < 10 and the result is true If the result is true, display true. If it is not true, display false. where a is the first number and b is the second number. Your solution will work for any two integer numbers. The format for other operators listed is the same for these operations.

(d) The program will then use the same two integer numbers and computes different operations using the following arithmetic assignment operators: =, /=, %= The result of these operations is stored in the first operand. See example below. a = b is 5 = 10 and the result is a = 5 If the result is true, display true. If it is not true, display false. or a /= b is 5 /= 10 and the result is a = 0 If the result is true, display true. If it is not true, display false. C:\Users\Ashoka Vardhan\Desktop\hw3\H3 ELET 230001 Fall 2017 .docxx, FA:09/27/2017 Fall 2017, H3 2 Note that a new value of a is used after each operation (i.e. a is rippled to other operations). The format for other operators listed is the same. Hints: 1. Your program will only have one main() function, one return statement, and anything declared globally, like #include . Parts b, c, and d are part of one .cpp file. 2. Make sure your program executes correctly 3. Make sure the variables are correctly declared without any conflicts with other variables. You may have to change some of the variables to make each variable unique. 4. You need to run the program four times for the numbers shown below. 5. Use conditional constructs or selection structures (like if, ifelse, etc) for this assignment.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions