Computers and Technology

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 in, out, 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 to it. 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.

I. Write C++ statements that produce the following output:

Name: //output the value of the variable name
Pay Rate: $ //output the value of 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 youwrote in parts a through 1. Place the statements at the appropriate place in the C++ program segment given at the beginning of this problem. Test run your program (twice) on the following input data:

//a. num1 = 13, num2 as 28; name as “Jacobson”; hoursWorked 48.30.

//b. num1 = 32, num2 as -15; name as “Crawford”; hoursWorked as 58.45.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:00, minelly1717
Your business be in google top rank. more the rank more the business leads. for best seo and digital marketing services be confident to contact you can get best seo solutions by assistance experts provide digital marketing, website development, seo expert services and social media internet seo expert services your branding solutions. seo expert services ,best seo expert services, online seo expert services,
Answers: 3
image
Computers and Technology, 24.06.2019 01:00, bellamyciana
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
image
Computers and Technology, 24.06.2019 02:10, sIatt
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
image
Computers and Technology, 24.06.2019 02:30, sha273
Which option completes the explanation for conflict of interest in an organization
Answers: 1
Do you know the correct answer?
Consider the following program segment: //include statement (s)
//using namespace statement

Questions in other subjects:

Konu
Chemistry, 07.06.2021 14:00
Konu
Social Studies, 07.06.2021 14:00
Konu
Mathematics, 07.06.2021 14:00