Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NOTE : code must be written in c++ language without any errors . Create a program that declares the following five variables: letter_1 is a

NOTE : code must be written in c++ language without any errors .

image text in transcribedimage text in transcribed

Create a program that declares the following five variables: letter_1 is a character variable. number_2 is an integer variable. value_3 is a Boolean variable. number_4 is a floating-point variable. - number_5 is a double float-point variable. Next prompt the user to enter a value for each variable from the keyboard: (The values entered by the user from the keyboard should be assigned to the variable.) - Enter a value for letter_1: (Enter A from the keyboard) Enter a value for number_2: (Enter o from the keyboard) - Enter a value for value_3: (Enter @ from the keyboard) Enter a value for number_4: (Enter 0.9 from the keyboard) Enter a value for number_5: (Enter 0.0 from the keyboard) Next perform the following arithmetic operations with each variable. a. letter_1 = letter_1 +32; b. number_2 = (2 + 3) * 6; c. value_3 (2 + 3) 6; d. number 4 = 3 / 5 * 22.0; e. number_5 = 3/5 * 22.0; Finally, display the new values of each variable as follows: The new value for letter_1 is: x (USING FIELD WIDTH OF 1) The new value for number_2 is: XXXXX (USING FIELD WIDTH OF 5) The new value for value_3 is: X (USING FIELD WIDTH OF 1) - The new value for number_4 is: Xxx.xx (USING FIELD WIDTH OF 5 WITH 2 DECIMAL PLACES) - The new value for number_5 is: xxxxx.xxxx (USING FIELD WIDTH OF 9 WITH 4 DECIMAL PLACES) The Name, Student ID and Section number that appears in the output of the program should be your own, not the ones used in the sample run. Sample run 1: Name: Smith, Peter Student ID: 300999999 Section: 001 Enter a value for letter_1: Enter a value for number_2: Enter a value for value_3: Enter a value for number_4: Enter a value for number_5: (Enter A from the keyboard) (Enter @ from the keyboard) (Enter from the keyboard) (Enter 0.0 from the keyboard) (Enter 0.0 from the keyboard) The new value for letter_1 is: x (NOTE: x is just a placeholder and not the actual value) The new value for number_2 is: XXXXX The new value for value_3 is: x The new value for number 4 is: XXX.XX The new value for number_5 is: XXXXX.XXXX NOTE: THERE SHOULD BE A TOTAL OF 1 SCREEN SHOT FOR THIS TASK. Press any key to continue

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions