Write a c++ statement that multiplies the value

Assignment Help C/C++ Programming
Reference no: EM13339811

1. Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer.

2. Consider the following program segment:
//include statement(s)
//using namespace statement
int main()
{
//variable declaration
//executable statements
//return statement
}

a. Write C++ statements that include the header files iostream and string.

b. Write a C++ statement that allows you to use cin, cout, and endl without the prefix std::.

c. Write C++ statements that declare and initialize the following named constants: SECRET of type int initialized to 11 and RATE of type double initialized to 12.50.

d. Write C++ statements that declare the following variables: num1, num2, and newNum of type int; name of type string; and hoursWorked and wages of type double.

e. Write C++ statements that prompt the user to input two integers and store the first number in num1 and the second number in num2.

f. Write a C++ statement(s) that outputs the values of num1 and num2, indicating which is num1 and which is num2. For example, if num1 is 8 and num2 is 5, then the output is:
The value of num1 = 8 and the value of num2 = 5.

g. Write a C++ statement that multiplies the value of num1 by 2, adds the value of num2 to it, and then stores the result in newNum. Then, write a C++ statement that outputs the value of newNum.

h. Write a C++ statement that updates the value of newNum by adding the value of the named constant SECRET. Then, write a C++ statement that outputs the value of newNum with an appropriate message.

i. Write C++ statements that prompt the user to enter a person's last name and then store the last name into the variable name.

j. Write C++ statements that prompt the user to enter a decimal number between 0 and 70 and then store the number entered into hoursWorked.

k. Write a C++ statement that multiplies the value of the named constant RATE with the value of hoursWorked and then stores the result into the variable wages.

l. Write C++ statements that produce the following output:
Name: //output the value of the variable name
Pay Rate: $ //output the value of the variable rate
Hours Worked: //output the value of the variable
//hoursWorked
Salary: $ //output the value of the variable wages
For example, if the value of name is "Rainbow" and hoursWorked is
45.50, then the output is:
Name: Rainbow
Pay Rate: $12.50
Hours Worked: 45.50
Salary: $568.75

m. Write a C++ program that tests each of the C++ statements that you wrote in parts a through l. Place the statements at the appropriate place in the previous C++ program segment. Test run your program (twice) on the following input data:
a. num1 = 13, num2 = 28; name = "Jacobson"; hoursWorked = 48.30.
b. num1 = 32, num2 = 15; name = "Crawford"; hoursWorked = 58.45.

Reference no: EM13339811

Questions Cloud

What is the force f2 that the larger piston could support : A small piston with area A1 = 45 cm^2 acts in a cylinder to lift a larger piston A2 = 550 cm^2 Find the force on the small piston (F1) if the pressure in the system is 7000 pascals.
Determine the temperature of the blood : Blood can carry excess energy from the interior to the surface of the body, where the energy is dispersed in a number of ways. determine the temperature of the blood
Mark the following statements as valid or invalid : Mark the following statements as valid or invalid. If a statement is invalid, explain why.
What is the depth of the flow in the channel during periods : Due to concerns about the salt water content in the estuary, the discharge in the channel needs to be varied to mimic tidal effects. This means that for 12 hours a day, the channel needs to carry a flow of 8m3.s1, and for the other 12 hours the fl..
Write a c++ statement that multiplies the value : Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer.
How much work is done by the electric field as third charge : how much work is done by the electric field as a third charge q3 = +2.19 nC is moved from point a to point b. (q1 = +9.41 nC, q2 = -9.41 nC)
Derive drag coefficient for f14 at max thrust and airspeed : Wingspan 64 m spread, 38 m swept Total Wing area Aw = 54.5 m2 Drag profile area Ap = 11.5 m2 Mass 27,700 kg fully loaded 2 x GE F110 Turbofan engines Thrust 61.4 kN from each engine
What is printed by the following program : What is printed by the following program?
What is the initial momentum of the offensive player : A football player who weighs 85 kg is carrying the ball directly up field at a rate of 15 km/hr. What is the initial momentum of the offensive player

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that reads numbers

Write a C++ program that reads N positive numbers from the keyboard, calculates and shows the smallest number of all numbers

  Write function named enough that takes one integer argument

Write a function named "enough" that takes one integer argument, call it "goal" and returns as its value the smallest positive integer n for which 1+2+3+. . . +n is at least equal to goal .

  Prepare an arbitrary sinusoidal waveform

Create a program to compute the derivative of an arbitrary input function, with arbitrary duration and arbitrary limits

  After the user presses any key

After the user presses any key, the board will be scrambled by making a large number of random moves (for a 3x3 puzzle, 100,000 attempted random moves in random directions will result in a sufficiently scrambled board)

  Implement a class called hugeinteger

Using your own Linked List implementation (see attached), implement a class called HugeInteger that represents arbitrary sized integers and supports addition only. You may only use the tools that have introduced in class, and you MAY NOT use Java'..

  Write an accessor function to get the angle

Write a friend function to compare the area of a rectangle with sides 12 and 8 to the area of a parallelogram with sides 14 and 18 and an acute angle of 40 degrees. Test it in main, and check the answer by hand.

  The funtion should take as parameters

Write a function in c ++ that multiplies two functions. the funtion should take as parameters two fraction structures. Then, the function should multiply the two fractions and return the solution as a fraction structure.

  Write an algorithm that converts a decimal number

Write an algorithm that converts a decimal number between 0 and 15 into its 4 bit unsigned binary representation and write an algorithm that converts a linear measurement in feet and inches into meters. One inch is equivalent to 2.54 centimeters.

  Write a program to make the ssds function

Write a program to make the SSDs function as a MM:SS real-time clock. Hint: You must not use a single delay routine for the one second delay because that will not allow for persistence of vision. The displays need to be constantly refreshed during ev..

  Binary tree, print right view of it

Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side.

  Techniques for information hiding and encapsulation

What techniques did you utilize for information hiding and encapsulation? Are there any improvements you would make? If so, what would they be?

  Object-oriented systems is the concept of object

At the heart of all object-oriented systems is the concept of an object. Simply stated, an object is a set of related characteristics and their associated actions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd