All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
microsoft visual c# introduction
Questions and Answers of
Microsoft Visual C# Introduction
A local department store wants a program that displays the number of reward points a customer earns each month. The reward points are based on the customer’s membership type and total monthly
In this exercise, you will modify the savings account program shown earlier in Figure 9-18. Follow the instructions for starting C++ and viewing the Intermediate20.cpp file, which is contained in
In this exercise, you will create a program that displays a measurement in either inches or centimeters. If necessary, create a new project named Introductory18 Project, and save it in the
In this exercise, you will create a program that displays the gross pay for one or more employees. If necessary, create a new project named Introductory17 Project, and save it in the Cpp8\Chap09
In this exercise, you will create a program that displays a table consisting of four rows and three columns. The first column should contain the numbers 10 through 13. The second and third columns
A program’s main function declares three double variables named salesTax, sales, and taxRate. It also declares a char variable named status. The main function contains the following statement:
Write a C++ statement that calculates the result of the following expression: (x / y)4 – 10. The x and y variables have the double data type. Assign the result to a double variable named answer.
Write a C++ statement that calculates the square root of the following expression: x2 * y3. The x and y variables have the double data type. Assign the result to a double variable named answer.
Write a C++ statement that adds the cube of the number stored in the num1 variable to the square root of the number stored in the num2 variable. The statement should assign the result to the answer
Write the C++ code for a function that prompts the user to enter a character and then stores the character in a char variable named response. The function should return the contents of the response
Write a C++ statement that assigns the square root of a number to a double variable named sqRoot. The number is stored in a double variable named num.
Write a C++ statement that displays a random integer from 50 through 100 on the computer screen.
Write an assignment statement that raises the number 3 to the 16th power and then assigns the result to a double variable named answer.
The variables in a function header have local scope. a. True b. False
A program contains three functions named main, calcGross, and displayGross. Two of the functions—main and calcGross—declare a variable named pay. The pay variable name also appears in the
A variable’s _____________________ indicates where in the program a variable can be used. a. Lifetime b. Range c. Scope d. Span
Unless specified otherwise, variables in C++ are passed _____________________ . a. By address b. By content c. By reference d. By value
Which of the following directs a function to return the contents of the stateTax variable to the statement that invoked it, which is contained in the main function? a. restore stateTax; b.
Which of the following is a valid function header for the getFee function, which receives an integer first and a number with a decimal place second? The function returns a number with a decimal
A program contains the statement tax = calcTax(sales);. The tax and sales variables have the double data type. Which of the following is a valid function header for the calcTax function? a.
Each memory location listed in a function header’s parameterList is referred to as _____________________ . a. An actual argument b. An actual parameter c. A formal argument d. A
Which of the following is false? a. The number of actual arguments should agree with the number of formal parameters. b. The data type of each actual argument should match the data type of
The function header specifies _____________________ . a. The data type of the function’s return value (if any) b. The name of the function c. The function’s formal parameters (if
Value-returning functions can return _____________________ . a. One value only b. One or more values c. The number 0 only d. None of the above
Follow the instructions for starting C++ and viewing the SwatTheBugs22.cpp file, which is contained in either the Cpp8\Chap08\SwatTheBugs22 Project folder or the Cpp8\Chap08 folder. (Depending on
Create a program that displays movie ratings in a bar chart, similar to the one shown in Figure 8-28. If necessary, create a new project named Advanced21 Project, and save it in the Cpp8\Chap08
Follow the instructions for starting C++ and viewing the Advanced20.cpp file, which is contained in either the Cpp8\Chap08\Advanced20 Project folder or the Cpp8\Chap08 folder. (Depending on your C++
In this exercise, you will modify the program from Lab 7-1 in Chapter 7. Follow the instructions for starting C++ and viewing the Intermediate17.cpp file, which is contained in either the
Create a program that displays a table consisting of ten rows and four columns. The first column should display prices from $5 to $50 in increments of $5. The second and subsequent columns should
Create a program that displays a table consisting of four rows and five columns. The first column should display the numbers 1 through 4. The second and subsequent columns should display the result
The code in Figure 8-24 should display the pattern of ampersands shown in the figure, but it is not working correctly. Debug the code. for (int row = 1; row < 4; row + 1) { for (int col = 1; col
Write the C++ code to display the integers 15, 12, 9, 6, 3, and 0 on separate lines on the computer screen. Use the for statement and an int variable named num.
A program declares an int variable named evenNum and initializes it to 2. Write the C++ code to display the even integers 2, 4, 6, 8, and 10 on separate lines on the computer screen. Use the do while
Write a C++ while clause that processes a posttest loop’s instructions as long as the value in the inStock variable is greater than the value in the reorder variable.
Chakura is sitting at a table in a bookstore, attending her book signing. Customers are standing in line waiting for her to sign their copy of her book. However, it is possible that some customers in
What number will the following code display on the computer screen? int sum = 0; int y = 0; do { for (int x = 1; x <= 5; x += 1) sum += x; //end for y +=
What pattern of asterisks will the following code display on the computer screen? for (int x = 1; x < 3; x += 1) { for (int y = 1; y < 4; y += 1) cout <<
What numbers will the following code display on the computer screen? int total = 1; do { total += 2; cout << total << endl; } while (total <= 3); a.
What value of x causes the loop in Review Question 5 to end? int x = 16; do { cout << x << endl; x -= 4; } while (x > 10); a. 0 b. 8 c.
Which of the following statements can be used to code a loop whose instructions you want processed 10 times? a. For b. Repeat c. While d. Either a or c
Which of the following updates the total accumulator variable by the value in the sales variable? a. total = total + sales; b. total = sales + total; c. total += sales; d. All of
What value stops the loop in Review Question 12? for (int numTimes = 4; numTimes <= 10; numTimes += 1) cout << numTimes << endl; //end for a. 4 b. 9 c.
How many times will the computer process the cout statement in the following code? for (int numTimes = 4; numTimes <= 10; numTimes += 1) cout << numTimes << endl; //end
What numbers will the following code display on the computer screen? int x = 0; do { cout << x << endl; x += 1; } while (x < 5); a. 0, 1, 2, 3,
It is possible that the instructions in the body of the _____________________ statement will not be processed during runtime. a. do while b. for c. while d. Both b and c
The instructions in the body of the _____________________ statement are always processed at least once during runtime. a. do while b. for c. while d. Both a and b
The condition in the do while statement is evaluated _____________________ the instructions in the loop body are processed. a. After b. Before
Follow the instructions for starting C++ and viewing the SwatTheBugs30.cpp file, which is contained in either the Cpp8\Chap07\SwatTheBugs30 Project folder or the Cpp8\Chap07 folder. (You may need to
Follow the instructions for starting C++ and viewing the SwatTheBugs29.cpp file, which is contained in either the Cpp8\Chap07\SwatTheBugs29 Project folder or the Cpp8\ Chap07 folder. (You may need to
Follow the instructions for starting C++ and viewing the SwatTheBugs28.cpp file, which is contained in either the Cpp8\Chap07\SwatTheBugs28 Project folder or the Cpp8\Chap07 folder. (You may need to
Create a program that allows the user to enter the gender (either F or M) and GPA (0.0 through 4.0) for any number of students. The program should calculate and display the average GPA for all
Baxter Skating Rink holds a weekly ice-skating competition. Competing skaters must perform a two-minute program in front of a panel of judges. The number of judges varies from week to week. At the
A thrift store discounts the price of its items using rates of 10% through 40% in increments of 5%. Create a program that allows the store clerk to enter an item’s original price. The program
Create a program that displays a multiplication table similar to the one shown in Figure 7-51. If necessary, create a new project named Introductory20 Project, and save it in the Cpp8\Chap07 folder.
Create a program that displays the weekly gross pay for any number of employees. The user will input the number of hours the employee worked and the employee’s hourly rate. Employees working more
Modify the solution shown earlier in Figure 7-2. The solution should now keep track of the number of times Sahirah’s laser beam missed the spider. After saying “You are safe now. The spider is
Write an assignment statement that subtracts the contents of the salesReturns variable from the sales accumulator variable.
Write an assignment statement that updates a counter variable named quantity by –5.
Write a C++ while clause that stops the loop when the value in the inStock variable is less than or equal to the value in the reorder variable.
Write a C++ for clause that processes the loop instructions 10 times. Use numTimes as the counter variable’s name.
Write a C++ while clause that processes the loop instructions as long as the value in the age variable is greater than the number 18.
Write an assignment statement that updates an accumulator variable named totalPay by the value in the grossPay variable.
What value stops the loop in Review Question 10? for (int numTimes = 1; numTimes < 10; numTimes += 2) cout << numTimes << endl; //end for a. 6 b. 9 c.
Use the code shown in Figure 6-34 to answer What will the code in Figure 6-34 display when the id variable contains the number 9? a. Janet b. Jerry c. Mark d. Sue switch (id)
Use the code shown in Figure 6-34 to answer What will the code in Figure 6-34 display when the id variable contains the number 4? a. Janet b. Jerry c. Mark d. Sue switch (id)
How many times will the computer process the cout statement in the following code? for (int numTimes = 1; numTimes < 10; numTimes += 2) cout << numTimes << endl; //end
A program allows the user to enter one or more numbers. The first input instruction will get the first number only and is referred to as the _____________________ read. a. Eentering b.
Values that are used to end loops are referred to as _____________________ values. a. Closing b. Ending c. Sentinel d. Stop
Which of the following is a good sentinel value for a program that allows the user to enter a person’s age? a. –4 b. 350 c. 999 d. All of the above
Which of the following indicates that the loop should stop when the value in the quantity variable is less than the number 50? a. while (quantity >= 50) b. while (quantity <
If necessary, create a new project named Advanced19 Project, and save it in the Cpp8\Chap06 folder. Enter (or copy) the instructions from the Lab6-2.cpp file into a new source file named
In this exercise, you will create a program that displays the number of daily calories needed to maintain your current weight. The number of calories is based on your gender, activity level, and
The C++ code in Figure 6-39 should display one of the four messages listed in the figure. The appropriate message is based on the level entered by the user. Correct the errors in the code.
A program uses a char variable named department and two double variables named salary and raise. The department variable contains one of the following letters (entered in either uppercase or
Use the code shown in Figure 6-34 to answer What will the code in Figure 6-34 display when the id variable contains the number 2? a. Janet b. Jerry c. Mark d. Sue switch (id)
Use the code shown in Figure 6-33 to answerWhat will the code in Figure 6-33 display when the id variable contains the character 2? a. Janet b. Jerry c. Mark d. Sue if (id -- '8')
Write the C++ code for a multiple-alternative selection structure that displays one of four different messages, depending on the number of seminar participants stored in an int variable named
Travis is standing in front of two containers: one marked Trash and the other marked Recycle. In his right hand, he is holding a bag that contains either trash or recyclables. Travis needs to lift
A program stores test scores in two int variables named myScore and expectedScore. Write the C++ code to compare the two scores and then display one of the following messages: “I met my
Use the code shown in Figure 6-33 to answerWhat will the code in Figure 6-33 display when the id variable contains the character 7? a. Janet b. Jerry c. Mark d. Sue if (id -- '8')
Use the code shown in Figure 6-33 to answerWhat will the code in Figure 6-33 display when the id variable contains the character 9? a. Janet b. Jerry c. Mark d. Sue if (id -- '8')
Use the code shown in Figure 6-33 to answerWhat will the code in Figure 6-33 display when the id variable contains the character 9? a. Janet b. Jerry c. Mark d. Sue if (id -- '8')
Use the code shown in Figure 6-32 to answer > number; cout" style="" class="fr-fic fr-dib">If the user enters the number 200, what value will be in the number variable after the selection
Use the code shown in Figure 6-32 to answer > number; cout" style="" class="fr-fic fr-dib">If the user enters the number 1000, what value will be in the number variable after the selection
Use the code shown in Figure 6-32 to answer > number; cout" style="" class="fr-fic fr-dib">If the user enters the number 90, what value will be in the number variable after the selection
Start your C++ development tool, and view the SwatTheBugs17.cpp file. The file is contained in either the Cpp8\Chap05\SwatTheBugs17 Project folder or the Cpp8\Chap05 folder. (Depending on your C++
As you learned in the chapter, you must be careful when comparing two real numbers for either equality or inequality because some real numbers cannot be stored precisely in memory. To determine
Figure 5-35 shows the Mifflin–St Jeor formulas for calculating a person’s basal metabolic rate (BMR), which is the minimum number of calories needed to keep his or her body functioning while
Allenton Water Department wants a program that calculates a customer’s monthly water bill. The clerk will enter the current and previous meter readings. The program should calculate and display the
A local department store is having a BoGoHo (Buy One, Get One Half Off) sale. The store manager wants a program that allows the salesclerk to enter the prices of two items. The program should
Mountain Coffee wants a program that allows a clerk to enter the number of pounds of coffee ordered, the price per pound, and whether the customer should be charged a 3.5% sales tax. The program
Correct the errors in the lines of code shown in Figure 5-32. The code variable has the char data type; the other variables have the int data type. if (toupper(code) = 'x') cout > quantity;
A program uses a char variable named department and two double variables named salary and raise. The department variable contains one of the following letters (entered in either uppercase or
A program stores sales amounts in two double variables named marySales and jimSales. Write the C++ code to assign the highest and lowest sales amounts to the highSales and lowSales variables,
Which of the following tells the computer to display real numbers in fixed-point notation with no decimal places? a. cout << fixed << decimal(0); b. cout << fixed <<
Which of the following is required in a program that uses the setprecision stream manipulator? a. #include b. #include c. #include d. #include
Which of the following compares the contents of an int variable named quantity with the number 5? a. if (quantity = 5) b. if (quantity == 5) c. if (quantity is 5) d. if (quantity
The expression 4 * 3 < 6 + 7 && 7 < 6 + 9 evaluates to _____________________ . a. True b. False
If an expression does not contain any parentheses, which of the following operators is performed first in the expression? a. Arithmetic b. Comparison c. Logical d. You can’t
The computer will perform short-circuit evaluation when processing which of the following if clauses? a. if (3 * 2 < 4 && 5 > 3) b. if (6 < 9 || 5 > 3) c. if (12
Showing 200 - 300
of 378
1
2
3
4