Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- Given the input: 46 A 49 and the C++ code: int x = 10, y = 18; char z = '*'; cin >> x

- Given the input:

46 A 49

and the C++ code:

int x = 10, y = 18;

char z = '*';

cin >> x >> y >> z;

cout << x << " " << y << " " << z << endl;

What is the output?

Please state any assumptions you may have made in the interpretation.

- Suppose that str1, str2, and str3 are string variables, and str1 = "Physics", str2 = "Computer Science", and str3 = "Biology".

Evaluate the following expressions as true or false. Justify your answers with evidence.

str1 >= str2

str1 != "physics"

str3 < str2

str2 >= "Chemistry"

- Suppose that overSpeed and fine are double variables. Write C++ if statements for the following conditions:

if 0 < overSpeed <= 5, the value assigned to fine is $20.00

else if 5 < overSpeed <= 10, the value assigned to fine is $75.00

else if 10 < overSpeed <= 15, the value assigned to fine is $150.00

else if overSpeed > 15, the value assigned to fine is $150.00 plus $20.00 per mile over 15

State and explain any assumptions you may have made to write these statements.

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions