Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 4 This exercise provides more practice in using FOR statements - Remove all code added between the II Your lab exercise ... comment lines

image text in transcribed
image text in transcribed
Exercise 4 This exercise provides more practice in using FOR statements - Remove all code added between the II Your lab exercise ... comment lines - Copylpaste the following between the comment lines int IntA, Rand, Sum =0, Product =1; double Fahrenheit, Celsius; srand(time(0); II Loop 9 times. Use IntA as the loop variable for (aaa) \{ II Generate a random number from 1 through 28 and assign to Rand bbb II Display random numbers on one line as shown in the example eee II Check if random number is an odd number if ( ddd) II The random number is odd. Add them together and assign to Sum II Use a compound arithmetic operator in the statement ccc 3 7 cout " 7 "; II Display the value of Sum as displayed in the example eee II Loop 3 times. Use IntA as the loop variable for ( aaa) \{ II Generate a random number from 0 through 100 and assign to Fahrenheit bbb II Convert Fahrenheit temperature to Celsius cec II Display temperatures as shown in the example. eee 3 - Change aaa to the FOR expression as described in the preceding comment. NOTE: You will lose 5 points for each incorrect expression - Change bbb to generate the random number as described in the preceding comment. NOTE: You will lose 5 points if the expression is wrong. - Change ccc to the statement that performs the action as described in the preceding comment - Change ddd to the IF expression that checks for ODD numbers - Change eee to the statement that performs the action as described in the preceding comment - To convert Fahrenheit to Celsius conversion Subtract 32 Multiply by the fraction 5/9 - Click on Run. The program should compile successfully - Take a screenshot that shows the Result pane showing the output Although the random numbers will be different, the Result Pane should show My nase is John Doe The date is 11 -03-2921 20:48 232684622122710 The addition of random odd numbers 1550 The Fahrenheft teaperature is 18 which is -7.77778 Celslus The Fahrenheit temperature is 74 which is 23,3333 Celsius The Fahrenhelt teeperature is 81 which is 27.2222 .elsius

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions