Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This lab is to give you more experience with C++ and prepare you for the quiz. Value 1. Fill in the table of Expression and

image text in transcribed
image text in transcribed
This lab is to give you more experience with C++ and prepare you for the quiz. Value 1. Fill in the table of Expression and Value Expression a 28/3-2 b 6 + 12 * 2-8 4 + 82 d 6 + 17 % 3-2 2 + 22" (9-7) (8 + 72 g (16 + 7) % 2-1 h 127(10-6) (19-3) (2 + 2)74 e f 2. Write out expressions as proper C++ statements. a. a = 12x b. z = 5x 14y + 6k c. y = x d. g = h + 12 4k e. c = a bk4 3. Casting question. Assume a program has the following variable definitions: int a, b = 2; float c = 4.2; and the following statement: a = b*c; What is the value stored in a? A) 8.4 B) 8 C) 0 D) None of the above 4. Formatting questions. Assume declarations: double divSales = 46.63942456; double totalAge = 432.8; double population = 69765.4567; For each part show what would be displayed. a) Write a cout statement so the variable divSales is displayed in a field of 8 spaces, in fixed point notation, with a precision of 2 decimal places. b) Write a cout statement so the variable totalAge is displayed in a field of 12 spaces, in fixed point notation, with a precision of 4 decimal places. c) Write a cout statement so the variable population is displayed in a field of 12 spaces, left-justified, with a precision of 8 decimal places. The decimal point should always be displayed. 5. Predict the output. What is the output? #include using namespace std; int main() { long x, y, z; x = y = z = 4; X += 2; y = 1; z = 3; cout

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

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago