For Question #1, would q be 4 or 4.0 and r 15 or 15.0? Or something else? For Qu
ID: 3886243 • Letter: F
Question
For Question #1, would q be 4 or 4.0 and r 15 or 15.0? Or something else? For Question #2, how would be do it by hand? Not running a program. For example just stating: int boxes = 12; Part 1. Basic statements and expressions. 1. Trace (show a "memory snapshot") the following statements by hand, showing your work: int f 4, g-2, h; double r-2.5, q; h-f+r/g 2. Translate the following into equivalent C statements: a. Declare a variable named tickets and assign to it a whole number between and 10 b. Double the current value of tickets and assign the new value back to tickets c. Declare a variable named cost and assign the cost of a recent ticket you purchased for some event. The cost variable should be able to store fractions of dollars as well as whole dollars 3. Assume that the following statement has been executed int boxes 12; The statement which would correctly display the value of boxes is (circle the letter of the correct answer) printf("%d", boxes); b. printf"%d", &boxes;); C. Scani("%d", &boxes;); d. printf("%f", boxes);Explanation / Answer
The Values will be q=4.0 and r=15.0
Step 1h=f+r/g;
here h=5
Step 2:g++ here g=3
Step 3: q=h%g*2;
q=5%3 is 2 and that will be 4 since q is float the value is 4.000
Step 4: r=f-(g-7)*q-h;
that will be 15 but since r is float it will be 15.0000
2)a) int tickets=5;
b)tickets=tickets*2;
tickets=tickets/2;
c)float cost;
cost=tickets;
3) printf("%d",boxes);
this will display the value 12
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.