Write a single C++ statement or line that accomplishes each of the following:
a) Print the message "Enter two numbers".
b) Assign the product of variables b and c to variable a.
c) State that a
d) Input three integer values from the keyboard into integer variables a, b and c.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
C++ How to Program (10th Edition)
Additional Engineering Textbook Solutions
Introduction To Programming Using Visual Basic (11th Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Management Information Systems: Managing the Digital Firm (15th Edition)
Survey of Operating Systems, 5e
- b) Wnite a C++ program, which uses a 'switch' statement to respond to different inputs from a user. The user may enter either 1, 2 or 3. If the input is 1, the program asks the user to input two numbers, which correspond to the length and width of a rectangle. The program then calculates the area of the rectangle and outputs the result by displaying the message "This is a rectangle. Its area is: Vvalue. If the input is 2, the program prints out the message "This is a triangle". If the input is 3, the program prints out the message "This is a circle"arrow_forwardCreate a c++ program. Use variable int, double, and/float onlyarrow_forwardC++ programming LAB ACTIVITY 1 - ALGORITHMBased on the problem below, you are required to:i. Identify the IPOii. Draw the flowchartarrow_forward
- C++arrow_forwardQ1: Write a C++ program to calculate the diagonal of a rectangle. Users are required to enter the length and width of the rectangle. If you enter negative values for length and width, you will receive a display message indicating incorrect input. Afterward, after verifying the validity of these variables, the rectangle's diagonal is calculated and displayed. Recall that d = vw² + 1².arrow_forwardCan you help with c++ please?arrow_forward
- in c++ programingarrow_forwardP1.arrow_forwardQ1: Write a C++ program to calculate the diagonal of a rectangle. Users are required to enter the length and width of the rectangle. If you enter negative values for length and width, you will receive a display message indicating incorrect input. Afterward, after verifying the validity of these variables, the rectangle's diagonal is calculated and displayed. Recall that d= vw2 +2. Write the code of Q1 in the space provide here 直 21°C j piltarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning