Question: Two variables, num and cost have been assigned values. Write a single statement that outputs num and cost to standard output. Print both values (


 Two variables,numandcosthave been assigned values. Write a single statement that outputsnumandcostto standard output. Print both values (numfirst, thencost), separated by a space on a single line that is terminated with a newline character. Do not output anything else.

These are wrong: 1. print(num,' ',cost)

2. Print (num,' ', cost, ' ')

=====

Question: Write a single statement that will print the message \"first is\" followed by the value offirst, and then a space, followed by \"second = \", followed by the value ofsecond. Print everything on one line and go to a new line after printing. Assume that the variables have already been given values.

Instructor Notes:

There should be a space between the string \"first is\" and the value of thefirstvariable.

=====

Question: Write some code that reads in a name and an age into the variablesnameandage. It then prints the message \"The age ofNAMEisAGE\" on a line by itself, whereNAMEandAGErepresent the values read into the variablesnameandagerespectively. For example, if your code read in \"Rohit\" and 70 then it would print out \"The age of Rohit is 70\" on a line by itself. There should NOT be a period in the output.

Instructor Notes:

Theageneeds to be an integer, not a string.

=====



Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!