New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
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
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer science
microsoft visual c# introduction
Microsoft Visual C# An Introduction to Object-Oriented Programming 7th edition Joyce Farrell - Solutions
Which of the following displays the number of characters contained in a string variable named address? a. cout << address.length() << endl; b. cout << numChars(address) << endl; c. cout << length(address) << endl; d. cout << size.address
Follow the instructions for starting C++ and viewing the SwatTheBugs30.cpp file, which is contained in either the Cpp8\Chap12\SwatTheBugs30 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) Read the program’s
In this exercise, you will create a program that allows the user to enter an employee’s gross pay amount as well as his or her filing status and number of withholding allowances. The program should calculate and display the amount of federal withholding tax (FWT) to deduct from the weekly gross
Follow the instructions for starting C++ and viewing the Advanced28.cpp file, which is contained in either the Cpp8\Chap12\Advanced28 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/ solution file first.) Notice that the pay codes
If necessary, create a new project named Advanced27 Project and save it in the Cpp8\Chap12 folder. Also create a new source file named Advanced27.cpp. JM Sales employs 10 salespeople. The sales made by the salespeople during the months of January, February, and March are listed in Figure 12-20.
In this exercise, you code an application that displays the number of times a value appears in a two-dimensional array. Follow the instructions for starting C++ and viewing the Advanced26.cpp file, which is contained in either the Cpp8\Chap12\ Advanced26 Project folder or the Cpp8\Chap12 folder.
Follow the instructions for starting C++ and viewing the Advanced25.cpp file, which is contained in either the Cpp8\Chap12\Advanced25 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/ solution file first.) Code the program so that
In this exercise, you modify the program from Computer Exercise 23. If necessary, create a new project named Intermediate24 Project and save it in the Cpp8\Chap12 folder. Copy the instructions from the Intermediate23.cpp file into a source file named Intermediate24.cpp. Change the filename in the
If necessary, create a new project named Intermediate23 Project and save it in the Cpp8\Chap12 folder. Also create a new source file named Intermediate23.cpp. Declare a seven-row, two-column int array named temperatures. The program should prompt the user to enter the highest and lowest
Follow the instructions for starting C++ and viewing the Introductory22.cpp file, which is contained in either the Cpp8\Chap12\Introductory22 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) The program should
Follow the instructions for starting C++ and viewing the Introductory21.cpp file, which is contained in either the Cpp8\Chap12\Introductory21 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) The program should
Follow the instructions for starting C++ and viewing the ModifyThis20.cpp file, which is contained in either the Cpp8\Chap12\ModifyThis20 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/ solution file first.) The file contains the
If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap12 folder. Enter the C++ instructions shown earlier in Figure 12-10 into a new source file named ModifyThis19.cpp. Change the filename in the first comment. Save and then run the program. Test the program
Follow the instructions for starting C++ and viewing the ModifyThis18.cpp file, which is contained in either the Cpp8\Chap12\ModifyThis18 Project folder or the Cpp8\Chap12 folder. (Depending on your C++ development tool, you may need to open the project/ solution file first.) The file contains the
The numbers array is a two-dimensional int array that contains three rows and five columns. The following statement should call the void calcTotal function, passing it the numbers array: calcTotal(numbers[3][5]);. Correct the statement.
Rewrite the code from Pencil and Paper Exercise 13 using the while statement Data From Exercise 13Write the code to display the largest number stored in the first column of a two-dimensional int array named orders. The array has five rows and two columns. Use the for statement.
Write the code to display the largest number stored in the first column of a two-dimensional int array named orders. The array has five rows and two columns. Use the for statement.
Write the code to find the square root of the number stored in the first row, third column in a two-dimensional double array named mathNumbers. Display the result on the screen.
Rewrite the code from Pencil and Paper Exercise 9 using two while statements. Data from Exercise 9Write the code to subtract the number 1 from each element in a two-dimensional int array named quantities. The array has 10 rows and 25 columns. Use two for statements.
Write the code to subtract the number 1 from each element in a two-dimensional int array named quantities. The array has 10 rows and 25 columns. Use two for statements.
Write the code to display the sum of the numbers stored in the following three elements contained in a two-dimensional double array named sales: the first row, first column; the second row, third column; and the third row, fourth column.
Write the statement to assign the C++ keyword true to the variable located in the third row, first column of a bool array named answers.
Use the sales array to answer. The array was declared using the int sales[2][5] = {{10000, 12000, 900, 500, 20000}, {350, 600, 700, 800, 100}}; statement. Which of the following verifies that the array subscripts stored in the row and col variables are valid for the sales array? a. if
Use the sales array to answer. The array was declared using the int sales[2][5] = {{10000, 12000, 900, 500, 20000}, {350, 600, 700, 800, 100}}; statement. Which of the following verifies that the array subscripts stored in the row and col variables are valid for the sales array? a. if
Use the sales array to answer. The array was declared using the int sales[2][5] = {{10000, 12000, 900, 500, 20000}, {350, 600, 700, 800, 100}}; statement. The statement cout << sales[0][3] + sales[1][3] << endl; will _____________________. a. Display 1300 b. Display
Use the sales array to answer. The array was declared using the int sales[2][5] = {{10000, 12000, 900, 500, 20000}, {350, 600, 700, 800, 100}}; statement. The statement sales[0][4] = sales[0][4 – 2]; will replace the number _____________________. a. 20000 with 900 b. 20000 with
Which of the following statements creates a two-dimensional array that contains three rows and four columns? a. int rates[3, 4] = {0}; b. int rates[4, 3] = {0}; c. int rates[3][4] = {0}; d. int rates[4][3] = {0}; The statement sales[1][3] += 10; will replace the number
The first element in a two-dimensional array has a row subscript of _____________________ and a column subscript of _____________________. a. 0, 0 b. 0, 1 c. 1, 0 d. 1, 1
Follow the instructions for starting C++ and viewing the SwatTheBugs36.cpp file, which is contained in either the Cpp8\Chap11\SwatTheBugs36 Project folder or the Cpp8\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) Run the program. The
In this exercise, you will create a program that allows the user to enter an unknown number of sales amounts for each of three car dealerships: Dealership 1, Dealership 2, and Dealership 3. Use a three-element double array to accumulate each dealership’s sales amounts. The program should
In this exercise, you code a program that uses three parallel numeric arrays. The program searches one of the arrays and then displays the corresponding values from the other two arrays. Follow the instructions for starting C++ and viewing the Advanced34.cpp file, which is contained in either the
In this exercise, you create a program that uses two parallel one-dimensional arrays. The program displays a shipping charge that is based on the number of items ordered by a customer. The shipping charge scale is shown in Figure 11-54. If necessary, create a new project named Advanced33 Project
In this exercise, you modify the program from Computer Exercise 31. The modified program will allow the user to change the grading scale while the program is running. If necessary, create a new project named Advanced32 Project and save it in the Cpp8\Chap11 folder. Also create a new source file
In this exercise, you create a program that uses two parallel one-dimensional arrays. Ms. Jenkins uses the grade table shown in Figure 11-52 for her Introduction to Programming course. She wants a program that displays the grade after she enters the total points earned. If necessary, create a new
In this exercise, you create a program that generates and displays six unique random integers for a lottery game. Each lottery number can range from 1 through 54 only. If necessary, create a new project named Advanced30 Project and save it in the Cpp8\Chap11 folder. Also create a new source file
In this exercise, you modify the program from Computer Exercise 28. If necessary, create a new project named Advanced29 Project and save it in the Cpp8\Chap11 folder. Also create a new source file named Advanced29.cpp. Copy the C++ instructions from the Advanced28.cpp file into the Advanced29.cpp
If necessary, create a new project named Advanced28 Project and save it in the Cpp8\Chap11 folder. Also create a new source file named Advanced28.cpp. The program should declare a 20-element, one-dimensional int array named commission. Assign the following 20 numbers to the array: 300, 500, 200,
Follow the instructions for starting C++ and viewing the Advanced27.cpp file, which is contained in either the Cpp8\Chap11\Advanced27 Project folder or the Cpp8\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/ solution file first.) Modify the program to
If necessary, create a new project named Advanced26 Project and save it in the Cpp8\Chap11 folder. Also create a new source file named Advanced26.cpp. Declare a 12-element int array named days. Assign the number of days in each month to the array, using 28 for February. Code the program so that it
Follow the instructions for starting C++ and viewing the Intermediate25.cpp file, which is contained in either the Cpp8\Chap11\Intermediate25 Project folder or the Cpp8\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) Code the program so
If necessary, create a new project named Intermediate24 Project and save it in the Cpp8\Chap11 folder. Enter the instructions shown earlier in Figure 11-23 into a source file named Intermediate24.cpp. Change the filename in the first comment to Intermediate24.cpp. Currently, the program displays
Follow the instructions for starting C++ and viewing the Intermediate23.cpp file, which is contained in either the Cpp8\Chap11\Intermediate23 Project folder or the Cpp8\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) The program uses an
Follow the instructions for starting C++ and viewing the Introductory22.cpp file, which is contained in either the Cpp8\Chap11\Introductory22 Project folder or the Cpp8\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) The program should
Follow the instructions for starting C++ and viewing the Introductory21.cpp file, which is contained in either the Cpp8\Chap11\Introductory21 Project folder or the Cpp8\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) The program should
In this exercise, you will modify the currency converter program from the chapter. If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap11 folder. Enter the C++ instructions shown earlier in Figure 11-25 into a source file named ModifyThis19.cpp. Change the
The numbers array is a five-element one-dimensional int array. The following statement should display the result of raising the first array element to the second power: cout << pow(nums[0], 2);. Correct the statement.
Draw a flowchart for the bubble sort program shown in Figure 11-34. 1 //Bubble Sort.cpp - uses the bubble sort to sort the 2 //contents of a one-dimensional array in ascending order 3 //Created/revised by on 4 5 #include 6 using namespace std; 7 8 int main() 9 { int numbers[4] {23, 46, 12, 35};
Rewrite the code from Pencil and Paper Exercise 13 using the for statement. Data From Exercise 13Write the code to display the smallest number stored in a one-dimensional int array named orders. The array has five elements. Use the while statement.
Write the code to display the smallest number stored in a one-dimensional int array named orders. The array has five elements. Use the while statement.
Write the code to find the square root of the number stored in the second element in a one-dimensional double array named mathNumbers. Display the result on the computer screen.
Rewrite the code from Pencil and Paper Exercise 10 using the for statement. Data From Exercise 10Write the code to subtract the number 1 from each element in a one-dimensional int array named quantities. The array has 10 elements. Use the while statement.
Write the code to subtract the number 1 from each element in a one-dimensional int array named quantities. The array has 10 elements. Use the while statement.
A program declares and initializes a one-dimensional int array named nums. Write the code to add together the numbers stored in the first and second array elements. Display the sum on the computer screen.
A program declares and initializes a one-dimensional int array named nums. Write the code to multiply the first element’s value by 2, storing the result in the numDoubled variable.
Write the statement to assign the C++ keyword true to the variable located in the third element in a one-dimensional bool array named answers.
Rewrite the code from Pencil and Paper Exercise 5 using the do while statement.
Write the code to display the contents of the rates array from Pencil and Paper Exercise 4. Use the for statement. Data From Exercise 4Write the statement to declare and initialize a one-dimensional double array named rates that has five elements. Use the following numbers to initialize the
Write the statement to declare and initialize a one-dimensional double array named rates that has five elements. Use the following numbers to initialize the array: 6.5, 8.3, 4.0, 2.0, and 10.5.
If the cities and zips arrays are parallel arrays, which of the following statements will display the city name associated with the zip code stored in the zips[8] variable? a. cout << cities[zips[8]] << endl; b. cout << cities(zips[8]) << endl; c. cout
Use the nums array to answer. The array was declared using the int nums[4] = {10, 5, 7, 2}; statement. The x and total variables are int variables and are initialized to 0. The avg variable is a double variable and is initialized to 0.0. What does the code in Review Question 8’s answer d
Use the nums array to answer. The array was declared using the int nums[4] = {10, 5, 7, 2}; statement. The x and total variables are int variables and are initialized to 0. The avg variable is a double variable and is initialized to 0.0. What does the code in Review Question 8’s answer c
Use the nums array to answer. The array was declared using the int nums[4] = {10, 5, 7, 2}; statement. The x and total variables are int variables and are initialized to 0. The avg variable is a double variable and is initialized to 0.0. What does the code in Review Question 8’s answer b
Use the nums array to answer. The array was declared using the int nums[4] = {10, 5, 7, 2}; statement. The x and total variables are int variables and are initialized to 0. The avg variable is a double variable and is initialized to 0.0. What does the code in Review Question 8’s answer a
Use the nums array to answer. The array was declared using the int nums[4] = {10, 5, 7, 2}; statement. The x and total variables are int variables and are initialized to 0. The avg variable is a double variable and is initialized to 0.0. Which of the following will correctly calculate the
Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000, 900, 500, 20000}; statement.a. while (x <= 4) x += 100; //end while b. while (x <= 4) { sales = sales + 100; x += 1; } //end while c. while (sales <
Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000, 900, 500, 20000}; statement.Which of the following if clauses verifies that the array subscript stored in the x variable is valid for the sales array? a. if (sales[x] >= 0 && sales[x] <
Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000, 900, 500, 20000}; statement.The cout << sales[0] + sales[1] << endl; statement will _____________________. a. display 22000 b. display 10000 + 12000 c. display sales[0] +
Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000, 900, 500, 20000}; statement.The sales[4] = sales[4 – 2]; statement will replace the number _____________________. a. 20000 with 900 b. 20000 with 19998 c. 500 with 12000 d. 500 with
Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000, 900, 500, 20000}; statement. The sales[3] += 10; statement will replace the number _____________________. a. 500 with 10 b. 500 with 510 c. 900 with 10 d. 900 with 910
Which of the following statements declares a five-element array named population? a. int population[4] = {0}; b. int population[5] = {0}; c. int population[4] = 0 d. int population[5] = {0}
Which of the following is false? a. The elements in an array are related in some way. b. All of the elements in an array have the same data type. c. All of the elements in a one-dimensional array have the same subscript. d. The first element in a one-dimensional array has a
Follow the instructions for starting C++ and viewing the SwatTheBugs25.cpp file, which is contained in either the Cpp8\Chap10\SwatTheBugs25 Project folder or the Cpp8\Chap10 folder. (Depending on your C++ development tool, you may need to open this exercise’s project/solution file first.) The
Follow the instructions for starting C++ and viewing the SwatTheBugs24.cpp file, which is contained in either the Cpp8\Chap10\SwatTheBugs24 Project folder or the Cpp8\Chap10 folder. (Depending on your C++ development tool, you may need to open this exercise’s project/solution file first.) The
In this exercise, you will create a program that displays the amount of a cable bill. The amount is based on the type of customer, as shown in Figure 10-30. For a residential customer, the user will need to enter the number of premium channels only. For a business customer, the user will need to
An online retailer wants a program that displays the total amount a customer owes, including shipping. The user will enter the total amount due before shipping. The amount to charge for shipping is based on the customer’s membership status, which can be either Standard or Premium. The appropriate
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 purchase amount, as shown in Figure 10-28. The program should use a separate void function for each
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 Introductory16 Project, and save it in the Cpp8\Chap10 folder. The program should allow the user to enter the number of hours the employee worked and his or
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 Introductory16 Project, and save it in the Cpp8\Chap10 folder. The program should allow the user to enter the number of hours the employee worked and his or
A program’s main function declares three double variables named sales, taxRate, and salesTax. It also contains the following function call: calcSalesTax (sales, taxRate, salesTax);. The calcSalesTax function is responsible for calculating the sales tax. Its function header looks like this: void
Desk-check the code shown in Figure 10-25. Show the desk-check table after the first four statements in the main function are processed. Also show it after the statement in the calcEnd function is processed. Finally, show the desk-check table after the calcEnd function ends. void calcEnd(int
Write the C++ code for a function that receives four items of information: three by value and one by reference. Each item has the double data type. Name the formal parameters num1, num2, num3, and avg. The function should calculate the average of the three numbers and then assign the result to the
Write the C++ code for a void function that receives four int variables: the first two by value and the last two by reference. Name the formal parameters n1, n2, sum, and diff. The function should calculate the sum of the two variables passed by value and then store the result in the first variable
Write the C++ code for a void function that receives three double variables: the first two by value and the last one by reference. Name the formal parameters n1, n2, and answer. The function should divide the n1 variable by the n2 variable and then store the result in the answer variable. Name the
When a variable is passed by reference, the computer assigns the name of its corresponding formal parameter to the variable’s location in memory. a. True b. False
Which of the following is false? a. The names of the formal parameters in the function header must be identical to the names of the actual arguments in the function call. b. When listing the formal parameters in a function header, you include each parameter’s data type and name. c.
Which of the following can be used to call the getNewPrice function described in Review Question 11? a. getNewPrice(double oldPrice, double newPrice); b. getNewPrice(&oldPrice, newPrice); c. getNewPrice(oldPrice, &newPrice); d. getNewPrice(oldPrice, newPrice);Data From
A program contains a void function named getNewPrice. The function receives two double variables named oldPrice and newPrice. The function multiplies the contents of the oldPrice variable by 1.1 and then stores the result in the newPrice variable. Which of the following is the appropriate function
If the function definitions section is located below the main function in a program, the program will have one function prototype for each program-defined function. a. True b. False
Which of the following is a correct function prototype for a void function that requires no formal parameters? The function’s name is displayName. a. displayName(); b. void displayName; c. void displayName(); d. void displayName(none);
Which of the following calls a void function named displayName, passing it no actual arguments? a. call displayName(); b. displayName; c. displayName() d. displayName();
To determine whether an item is being passed by value or by reference, you must examine either the _________________________ or the _________________________. a. Function call, function header b. Function call, function prototype c. Function header, function prototype d.
Which of the following statements calls the getInventory function described in Review Question 4? a. getInventory(int, int, int, int); b. getInventory(beginInv, sales, purchases, &endInv); c. getInventory(beginInv, sales, purchases, endInv); d. getInventory(int beginInv, int
A void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv. The function’s task is to calculate the ending inventory, using the beginning inventory, sales, and purchase amounts passed to the function. The function should store the result in the
A void function named getEndBal is passed the values stored in two int variables. Which of the following function prototypes is correct for this function? a. void getEndBal(int, int); b. void getEndBal(int, int) c. void getEndBal(int &, int &); d. int getEndBal(void);
Which of the following correctly calls a void function named displayTotal, passing it an int variable named total? a. cout << displayTotal(int total); b. cout << displayTotal(total); c. displayTotal(int total); d. displayTotal(total);
Which of the following is false? a. A void function does not contain a return statement. b. A void function call typically appears as its own statement in a C++ program. c. A void function cannot receive any items of information when it is called. d. A void function header
Follow the instructions for starting C++ and viewing the SwatTheBugs26.cpp file, which is contained in either the Cpp8\Chap09\SwatTheBugs26 Project folder or the Cpp8\Chap09 folder. (Depending on your C++ development tool, you may need to open this exercise’s project/solution file first.) The
In this exercise, you will create a program that displays the amount of a cable bill. The amount is based on the type of customer, as shown in Figure 9-43. For a residential customer, the user will need to enter the number of premium channels only. For a business customer, the user will need to
Create a program that displays five random addition problems, one at a time, on the computer screen. Each problem should be displayed as a question, like this: What is the sum of x + y?. The x and y in the question represent random numbers from 1 to 10, inclusive. After displaying the question, the
An online retailer wants a program that displays the total amount a customer owes, including shipping. The user will enter the total amount due before shipping. The amount to charge for shipping is based on the customer’s membership status, which can be either Standard or Premium. The appropriate
Showing 100 - 200
of 378
1
2
3
4
Step by Step Answers