Question: CHAPTER 3 REVIEW EXERCISES Code statements: For the following otherwise specified. exercises, presume that the relevant variables have already been declared, unless integer variable Write
CHAPTER 3 REVIEW EXERCISES Code statements: For the following otherwise specified. exercises, presume that the relevant variables have already been declared, unless integer variable Write a statement that reads an integer value from standard input into the number. Write a statement that reads a floating point (real) value from standard input into the double variable temperature .Assume that we have a string type variable called name and short type variable called age. Write code that asks the user and accepts the user entered values into the variables name and age. Then print the message "The age of cnames is cage>.- For example, if your code read in "Sara" and 17, then your code would print out "The age of Sara is 17- Write code that would reads a number from the keyboard into the integer variable number.Then print out the variable 's value, thrice the value, and the cube of the value, separated by spaces. For example if I enter 2, the code should display 268 Assume the dimensions (width and length) of one room have been read into two float variables (width1 and length1), and the dimensions of a second room have been read into two other variables(width2 and length2). Write a single expression that will calculate the total area of the two rooms and store it in a variable named totalArea. * .Assume that price is an integer variable that contains the price (in US currency) in cents of an item, Write a statement that prints the value of price in the form "X dollars and Y cents" So, if the value of price was 4321, your code would print "43 dollars and 21 cents .Assume that brushCount is an integer variable containing the number of paint brushes in a box and that boxCount is an integer variable containing the number of boxes in a store. Write an expression that calculates the average number of brushes per box. Write a statement using a compound assignment operator to calculate half price of a given ticket price stored in the variable. . .Write a statement using the increment operator to increase the value of the integer variable num_steps by 10. statement that prints it out in a print field of 10 positions string variable prefix Assume that classCount is an int variable that has been given a value.Write a Write an expression that concatenates the string variable suffix onto the end of the Program Joe's Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. Write a complete program that will perform the following steps: Ask the user for the diameter of the pizza in inches. Calculate the number of slices that may be taken from a pizza of that size. .Display a message telling the number of slices. To calculate the number of slices that may be taken from the pizza, you must know the following facts: .Each slice should have an area of 14.125 inches. To calculate the number of slices, simply divide the area of the pizza by 14.125 The area of the pizza is calculated with this formula: Area - "pir squared" where pi is approximately 3.14159 and r is the radius (half the diameter)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
