(b) Write a program whepe we want the usge to enter two floats an then choose of options: tadd the two nunibers, subtruct the Two numbers multiply tne two numbers. divido the Ywo numbers or exit 8e program. The code should allow the user to choose from a list of the above alternatives. In this case, consider a menu driven program. You need to print a list of choices and have a user pick from that list. In such a situation you may ant to use if statement and then nest an if statement inside of the else clause.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 20PE: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making...
icon
Related questions
Question
please answer it in c++ language 1b
QUESTION 1
(a)
statements. When you want to check multiple conditions there may be a need to put
one if by a user is between two numbers. This could be written using two if
statements the outer if statement checking to see if the value entered is greater than
some minimum, and the inner if statement checking to see if the value entered is less
than some maximum. Let's consider the following possibility: suppose you are asked
to write a program that finds the maximum of three integers. This can be
accomplished by writing nested if statements. The figure below depicts the flow of
control for such a program
Any statement may be placed.within an if statement, including other if
Get input of integers
X, y and z
True
y > x
False
z>y
z>x
False
True
False
True
Print (z)
Print (y)
Print (z)
Print (x)
Print (Done)
Write a complete program to find the max of three integers. A program should
determine which of the three integers, x, y and z, was the greatest by first comparing
two of them, say x and y. Then depending on the outcome of that condition, compare
two more integers using nesting if statements to determine which is greatest.
2 | Bachelor of Engineering
(b) Write a program whepe we want the user to enter two floats and then choose of
options: tadd the two numbers, subtract the Two numbers multiply ine two numbers.
divido the Two numbers or exit e program The code should allow the user to choose
from a list of the above alternatives, In this case, consider a menu driven program.
You need to print a list of choices and have a user pick from that list. In such a
situation you may ant to use if statement and then nest an if statement inside of the
else clause.
(c) Create a program that reads two integers, a and b, from the user. Your program
should compute display.
The sum of a and b
The difference when b is subtracted from a
The product of a and b
The quotient when a is divided by b
The remainder when a is divided by b
The result of log1na.
• The result of a.
Transcribed Image Text:QUESTION 1 (a) statements. When you want to check multiple conditions there may be a need to put one if by a user is between two numbers. This could be written using two if statements the outer if statement checking to see if the value entered is greater than some minimum, and the inner if statement checking to see if the value entered is less than some maximum. Let's consider the following possibility: suppose you are asked to write a program that finds the maximum of three integers. This can be accomplished by writing nested if statements. The figure below depicts the flow of control for such a program Any statement may be placed.within an if statement, including other if Get input of integers X, y and z True y > x False z>y z>x False True False True Print (z) Print (y) Print (z) Print (x) Print (Done) Write a complete program to find the max of three integers. A program should determine which of the three integers, x, y and z, was the greatest by first comparing two of them, say x and y. Then depending on the outcome of that condition, compare two more integers using nesting if statements to determine which is greatest. 2 | Bachelor of Engineering (b) Write a program whepe we want the user to enter two floats and then choose of options: tadd the two numbers, subtract the Two numbers multiply ine two numbers. divido the Two numbers or exit e program The code should allow the user to choose from a list of the above alternatives, In this case, consider a menu driven program. You need to print a list of choices and have a user pick from that list. In such a situation you may ant to use if statement and then nest an if statement inside of the else clause. (c) Create a program that reads two integers, a and b, from the user. Your program should compute display. The sum of a and b The difference when b is subtracted from a The product of a and b The quotient when a is divided by b The remainder when a is divided by b The result of log1na. • The result of a.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr