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
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
an introduction programming
Questions and Answers of
An Introduction Programming
In this exercise, you modify the patio area program shown in Figure 15-7 in the chapter. If necessary, create a new project named ModifyThis11 Project and save it in the Cpp8\Chap15 folder. Enter the
In this exercise, you modify the pizza slices program shown in Figure 15-10 in the chapter. If necessary, create a new project named ModifyThis10 Project and save it in the Cpp8\Chap15 folder. Enter
In this exercise, you modify the program from TRY THIS Exercise 8. If necessary, create a new project named ModifyThis9 Project and save it in the Cpp8\Chap15 folder. Copy the instructions from the
In this exercise, you complete a program that uses the FormattedDate class shown in Figure 15-1 in the chapter. Follow the instructions for starting C++ and viewing the TryThis8.cpp file, which is
In this exercise, you use the Employee class from Pencil and Paper Exercise 4 to create an Employee object. Follow the instructions for starting C++ and viewing the TryThis7.cpp file, which is
Include another public method in the Employee class from Pencil and Paper Exercise 3. The method should calculate an Employee object’s new salary, which is based on the raise percentage provided by
Include two additional public methods in the Employee class from Pencil and Paper Exercise 2. One method should allow a program to view the contents of the salary data member. The other method should
Include an additional public method in the Employee class from Pencil and Paper Exercise 1. The method should allow a program to assign values to the data members after an Employee object has been
Write the class definition for a class named Employee. The class should include private data members for an Employee object’s name and salary. The salary may contain a decimal place. The class
You expose a member of a class by recording the member below the _____________________ keyword in the class statement.a. Commonb. Exposedc. Publicd. Unrestricted
In this exercise, you will modify the program from TRY THIS Exercise 17. If necessary, create a new project named ModifyThis18 Project and save it in the Cpp8\Chap14 folder. Copy the instructions
If necessary, create a new project named TryThis17 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named TryThis17.cpp. Write a program that saves records to a sequential
If necessary, create a new project named TryThis16 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named TryThis16.cpp. Write a program that allows the user to enter the
Rewrite the statement from Pencil and Paper Exercise 2 so it opens the janSales.txt file for append.
Write the statement to open a sequential access file named janSales.txt for output. The file is associated with the outJan object.
Write the statement to declare an input file object named inSales.
A group of related fields that contain all of the data about a specific person, place, or thing is called a _____________________.a. Fieldb. Filec. Recordd. None of the above
Write a C++ statement that assigns the number of characters contained in the message variable to an int variable named numChars.
Write a C++ statement that uses the erase function to remove the first two characters from the message variable.
Rewrite the code from Pencil and Paper Exercise 2 using the replace function.
Some credit card companies assign a special digit, called a check digit, to the end of each customer’s credit card number. Many methods for creating the check digit have been developed. One very
In this exercise, you modify the program from ADVANCED Exercise 31. If necessary, create a new project named Advanced32 Project and save it in the Cpp8\Chap13 folder. Also create a new source file
In this exercise, you modify the program from Lab 13-2. If necessary, create a new project named Advanced31 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named
In this exercise, you modify the program from ADVANCED Exercise 29. If necessary, create a new project named Advanced30 Project and save it in the Cpp8\Chap13 folder. Also create a new source file
Follow the instructions for starting C++ and viewing the Advanced29.cpp file, which is contained in either the Cpp8\Chap13\Advanced29 Project folder or the Cpp8\Chap13 folder. (Depending on your C++
In this exercise, you modify the Social Security Number program from the chapter. If necessary, create a new project named Intermediate24 Project and save it in the Cpp8\Chap13 folder. Enter the
In this exercise, you modify the program from ModifyThis Exercise 19. If necessary, create a new project named Intermediate22 Project and save it in the Cpp8\Chap13 folder. Enter (or copy) the C++
In this exercise, you modify one of the ZIP code programs from the chapter. If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap13 folder. Enter the C++
In this exercise, you will modify the program from TRY THIS Exercise 17. If necessary, create a new project named ModifyThis18 Project and save it in the Cpp8\Chap13 folder. Copy the instructions
If necessary, create a new project named TryThis17 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named TryThis17.cpp. Write a program that allows the user to enter a
If necessary, create a new project named TryThis16 Project and save it in the Cpp8\Chap13 folder. Enter the C++ instructions from Figure 13-15 into a source file named TryThis16.cpp. Change the
If the msg variable contains the string “Happy holidays”, what will the cout << msg.find("day", 0); statement display on the screen?a. –1b. 0c. 10d. 11
If the word variable contains the string “Bells”, which of the following statements will change the contents of the variable to “Bell”?a. word.erase(word.length() – 1, 1);b.
Follow the instructions for starting C++ and viewing the TryThis17.cpp file, which is contained in either the Cpp8\Chap12\TryThis17 Project folder or the Cpp8\Chap12 folder. (Depending on your C++
Follow the instructions for starting C++ and viewing the TryThis16.cpp file, which is contained in either the Cpp8\Chap12\TryThis16 Project folder or the Cpp8\Chap12 folder. (Depending on your C++
Rewrite the code shown in Example 3 in Figure 12-5 so it displays the contents of the prices array, column by column. Use an outer for loop and a nested while loop. HOW TO Display the Contents of a
Rewrite the code from Pencil and Paper Exercise 4 using the do while statement in the outer loop and the while statement in the nested loop.
Write the code to store the number 100 in each element in the balances array from Pencil and Paper Exercise 1. Use two for statements.
Rewrite the code from Pencil and Paper Exercise 2 to display the array, column by column.
Write the code to display the contents of the balances array from Pencil and Paper Exercise 1. Use two for statements to display the array, row by row.
Write the code to declare and initialize a two-dimensional double array named balances that has four rows and six columns.
The statement cout << sales[0][3] + sales[1][3] << endl; will _____________________.a. display 1300b. display 1600c. display sales[0][3] + sales[1][3]d. result in an error
The statement sales[1][3] += 10; will replace the number _____________________.a. 900 with 910b. 500 with 510c. 700 with 710d. 800 with 810
In this exercise, you modify the highest number program from the chapter. If necessary, create a new project named ModifyThis20 Project and save it in the Cpp8\Chap11 folder. Enter the C++
If necessary, create a new project named TryThis18 Project and save it in the Cpp8\Chap11 folder. Enter the C++ instructions shown earlier in Figure 11-23 into a source file named TryThis18.cpp.
If necessary, create a new project named TryThis17 Project and save it in the Cpp8\Chap11 folder. Enter the C++ instructions shown earlier in Figure 11-19 into a source file named TryThis17.cpp.
Which of the following will correctly add the number 100 to each variable in the sales array? The x variable was declared using the int x = 0; statement.a. while (x <= 4)
The cout << sales[0] + sales[1] << endl; statement will _____________________.a. display 22000b. display 10000 + 12000c. display sales[0] + sales[1]d. result in an error
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] = 0d. int population[5] = {0}Use the sales
In this exercise, you will modify the program from Lab10-2. If necessary, create a new project named Intermediate20 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions from the
In this exercise, you will modify the program that you created in Chapter 6’s Lab 6-2. If necessary, create a new project named Intermediate18 Project, and save it in the Cpp8\Chap10 folder. Copy
In this exercise, you will modify the guessing game program from Figure 9-11 in Chapter 9. Follow the instructions for starting C++ and viewing the Introductory15.cpp file, which is contained in
In this exercise, you will modify the program from Lab10-1. Follow the instructions for starting C++ and viewing the ModifyThis14.cpp file, which is contained in either the Cpp8\Chap10\ModifyThis14
In this exercise, you will modify the program from Lab 9-2 in Chapter 9. If necessary, create a new project named ModifyThis13 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions
In this exercise, you will modify the program from TRY THIS Exercise 11. If necessary, create a new project named ModifyThis12 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions
If necessary, create a new project named TryThis11 Project, and save it in the Cpp8\Chap10 folder. Code the IPO charts shown in Figure 10-26. Enter your C++ instructions into a source file named
In this exercise, you will modify the program from Lab 9-1 in Chapter 9. Follow the instructions for starting C++ and viewing the TryThis10.cpp file, which is contained in either the
In this exercise, you will experiment with passing variables by value and by reference. a. Follow the instructions for starting C++ and viewing the TryThis9.cpp file, which is contained in
Rewrite the code from Pencil and Paper Exercises 1 and 2 so that the getProduct function receives two integers, a double number, and the address of a double variable from the calling statement. The
Write the function prototype for the getProduct function from Pencil and Paper Exercise 1. Also write the statement to call the function. Name the actual arguments firstNum, secondNum, and product.
Write the C++ code for a function that receives an integer, a double number, and the address of a double variable from the calling statement. The function should multiply the integer by the double
Which of the following is false?a. When you pass a variable by reference, the receiving function can change the variable’s contents.b. When you pass a variable by value, the receiving function
In this exercise, you will modify the program that you created in Chapter 6’s Lab 6-2. If necessary, create a new project named Intermediate21 Project, and save it in the Cpp8\Chap09 folder. Copy
In this exercise, you will modify the car payment program from Lab 9-2. If necessary, create a new project named Intermediate19 Project, and save it in the Cpp8\Chap09 folder. Copy the instructions
In this exercise, you will modify the program from Computer Exercise 12. If necessary, create a new project named ModifyThis14 Project, and save it in the Cpp8\Chap09 folder. Enter (or copy) the
In this exercise, you will modify the hypotenuse program shown earlier in Figure 9-6.Follow the instructions for starting C++ and viewing the ModifyThis13.cpp file, which is contained in either the
If necessary, create a new project named TryThis12 Project, and save it in the Cpp8\Chap09 folder. Code the IPO charts shown in Figure 9-37. Enter your C++ instructions into a source file named
If necessary, create a new project named TryThis11 Project, and save it in the Cpp8\Chap09 folder. Create a program that displays the average of three integers. The program should pass the three
Write the function prototype for the getProduct function from Pencil and Paper Exercise 1. Also write the statement to call the function, assigning its return value to the product variable. Name the
Write the C++ code for a function that receives an integer followed by a double number from the calling statement. The function should multiply the integer by the double number and then return the
Which of the following is a valid function prototype for the function described in Review Question 6?a. getFee(int base, double rate);b. int getFee(int, double)c. double getFee(int base, double
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. The program should calculate the
At the beginning of every year, Khalid receives a raise on his previous year’s salary. He wants a program that calculates and displays the amount of his annual raises for the next three years,
In this exercise, you will modify the program from Lab 7-2 in Chapter 7. If necessary, create a new project named Intermediate16 Project, and save it in the Cpp8\Chap08 folder. Copy the instructions
Create a program that a professor can use to display a grade for any number of students. Each student’s grade is based on four test scores, with each test worth 100 points. The program should total
In this exercise, you will modify the car depreciation program from Figure 8-12. Follow the instructions for starting C++ and viewing the ModifyThis12.cpp file, which is contained in either the
In this exercise, you will modify the code from Exercise 10. If necessary, create a new project named ModifyThis11 Project, and save it in the Cpp8\Chap08 folder. Enter (or copy) the TryThis10.cpp
In this exercise, you will create a program that displays the pattern of asterisks shown in Figure 8-26. Use the while statement for the outer loop. Use the do while statement for the nested loop. If
In this exercise, you will create a program that uses two for statements to display the pattern of asterisks shown in Figure 8-25. If necessary, create a new project named TryThis9 Project, and save
Rewrite the code from Figure 8-21 so it uses the for statement for the nested loop. int nested = for (int outer = 1; outer
Complete a desk-check table for the code shown in Figure 8-22. What will the code display on the computer screen? What value causes the nested loop to end? What value causes the outer loop to end?
Complete a desk-check table for the code shown in Figure 8-21. What will the code display on the computer screen? What value causes the nested loop to end? What value causes the outer loop to end?
What numbers will the following code display on the computer screen?int x = 16;do{cout << x << endl;x -= 4;} while (x > 10);a. 16, 12, 8b. 16, 12c. 20, 16, 12, 8d. 20, 16, 12
If necessary, create a new project named Advanced27 Project, and save it in the Cpp8\Chap07 folder. Enter the C++ instructions shown earlier in Figure 7-11 into a source file named Advanced27.cpp.
Create a program that displays the first 10 Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, 21, 34, and 55). Notice that beginning with the third number in the series, each Fibonacci number is the sum of
In this exercise, you create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local companies. Figure 7-53 shows the charge for attending a
Create a program that displays the ending balance in a savings account, given the beginning balance, the deposit amounts, and the withdrawal amounts. Use two loops in the program: one to get the
Create a program that a teacher can use to enter the midterm and final test scores for any number of students. Each test is worth 200 points. The program should display each student’s grade, which
In this exercise, you will modify the sales program from Lab7-2. If necessary, create a new project named ModifyThis17 Project, and save it in the Cpp8\Chap07 folder. Enter (or copy) the Lab7-2.cpp
In this exercise, you will modify the tip program shown earlier in Figure 7-31. Follow the instructions for starting C++ and viewing the ModifyThis16.cpp file, which is contained in either the
Create a program that allows the user to enter the ages (in years) of five people. The program should display the average age. Use the for statement. Display the average age with one decimal place.
Create a program that allows the user to enter any number of integers. The program should display the sum of the integers. Use the while statement and a negative number as the sentinel value. If
Figure 7-23 in the chapter showed two examples of the for statement. List the processing-steps for the code shown in Example 2, using Figure 7-24 as a guide. Syntax for (linitialization]; condition;
Rewrite the code shown in Figure 7-48 to use the for statement. int num = 6; while (num >= 0) { cout
Rewrite the code shown in Figure 7-49 to use the while statement. for (int num = 1; num < 6; num += 2) { cout
Complete a desk-check table for the code shown in Figure 7-49. What will the code display on the computer screen? What value stops the loop? for (int num 1; num < 6; num += 2) { cout
Complete a desk-check table for the code shown in Figure 7-48. What will the code display on the computer screen? What value stops the loop? int num = 6; while (num >= 0) { cout > Figure 7-48
Follow the instructions for starting C++ and viewing the SwatTheBugs22.cpp file, which is contained in either the Cpp8\Chap06\SwatTheBugs22 Project folder or the Cpp8\Chap06 folder. (Depending on
In this exercise, you will include a Boolean value in a switch statement. Follow the instructions for starting C++ and viewing the Advanced21.cpp file, which is contained in either the
In this exercise, you will experiment with the switch statement.a. Follow the instructions for starting C++ and viewing the Advanced20.cpp file, which is contained in either the
Showing 1 - 100
of 141
1
2