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
The expression 4 > 3 && 7 >= 4 evaluates to _____________________ . a. True b. False
Which of the following conditions evaluates to true when the letter variable contains the letter Z in either uppercase or lowercase? a. if (letter = 'Z' || letter = 'z') b. if (letter == 'Z' || letter == 'z') c. if (letter = 'Z' && letter = 'z') d. if (letter == 'Z'
Which of the following is a valid if clause? (The average variable has the double data type.) a. if (average > 70.5 && average < 80.5) b. if (average < 70.5 && average > 80.5) c. if (average < 70.5 || > 80.5) d. if (average > 70.5 &&
If an if statement’s true path contains the statement double avg = 0.0;, where can the avg variable be used? a. In any instruction after the declaration statement in the entire program b. In any instruction after the declaration statement in the if statement c. In any instruction
Correct the errors in the lines of code shown in Figure 4-34. (The code contains eight errors.)
Complete the C++ instructions column in Figure 4-33. IPO chart information C++ instructions Input number of pets number of owners int pets = 0; int owners = 0; Processing none Output number of pets per owner double petsPerOwner 0.03; Algorithm: 1. enter number of pets and number of owners 2.
Complete the C++ instructions column in Figure 4-32. IPO chart information C++ instructions Input quantity sold item cost int quantity = 0; double cost = 0.0; double sellPrice item selling price = 0.0; Processing price and cost difference double difference = 0.0; Output profit double profit =
Complete the C++ instructions column in Figure 4-31. IPO chart information C++ instructions Input quantity total cost int quantity = 0; double total - 0.0; Processing none Output Cost per item double itemCost 0.0; Algorithm: 1. enter the quantity and total cost cout > quantity; 2. calculate
Which of the following is a valid comment in C++? a. **This is a comment b. @/This is a comment c. /This is a comment d. None of the above
Which of the following is equivalent to the rate = rate / 100; statement? a. rate =/ 100; b. rate /= 100: c. rate / = 100; d. rate /= 100;
Which of the following tells the compiler to merge the code contained in the iostream file with the current file’s code? a. #include iostream; b. #include c. #include ; d. #include (iostream)
Which of the following statements advances the cursor to the next line on the computer screen? a. cout << endl; b. cout << endline; c. cout << newline; d.None of the above
Which of the following explicitly converts the contents of an int variable named quantity to the double data type? a. castToDouble(quantity) b. explicit_cast (quantity) c. static_cast (quantity) d. type_cast (quantity)
Which of the following assigns the letter T to a char variable named insured? a. insured = 'T'; b. insured = "T": c. insured = "T"; d. insured = 'T':
The num1 and num2 variables have the int data type and contain the numbers 13 and 5, respectively. The answer variable has the double data type. Which of the following statements will require an explicit type conversion to evaluate correctly? a. answer = num1 / 4.0; b. answer = num1 +
If the payRate variable has the double data type, which of the following statements will require an explicit type conversion to evaluate correctly? a. payRate = 25; b. payRate = payRate * 1.05; c. payRate /= 2; d. None of the above
Which of the following sends keyboard input to a variable named payRate? a. cin >> payRate; b. cin << payRate; c. cin <> payRate; d. cin > payRate;
Which of the following prompts the user to enter an hourly pay rate? a. cout >> "Pay rate per hour? "; b. cout << "Pay rate per hour? "; c. cout >> "Pay rate per hour? ": d. cout << "Pay rate per hour? ":
Archie wants a program that calculates and displays a team’s final score in a football game, given the numbers of the team’s field goals, touchdowns, one-point conversions, two-point conversions, and safeties. First, create an IPO chart for this problem, and then desk-check the algorithm twice.
Builders Inc. wants a program that allows its salesclerks to enter the diameter of a circle and the price of railing material per foot. The program should calculate and display the total price of the railing material. Use 3.1416 as the value of pi. First, create an IPO chart for this problem, and
Michael wants a program that calculates and displays the percentage of the total points he contributed to his basketball team’s final score. Michael will provide the number of twopoint baskets, the number of three-point baskets, and the number of free throw points his team made. He will also
Gabrielle receives 52 paychecks each year. She always deposits a specific percentage of her gross pay into her savings account. She also receives a bonus check, which is always more than $250, at the end of the year. She always deposits $150 of her bonus into her savings account. Gabrielle wants a
Cranston Berries sells three types of berries: strawberries, blueberries, and raspberries. Sales have been booming this year and are expected to increase next year. The sales manager wants a program that allows him to enter the projected increase (expressed as a decimal number) in berry sales for
Juan wants a program that calculates and displays the number of miles per gallon he drove his car on a recent trip. When he started the trip, the car’s gas tank was full and its odometer read 5500. Before reaching his final destination, Juan stopped at two different gas stations to purchase gas.
Correct the C++ instructions shown in Figure 3-26. IPO chart information C++ instructions Input original price discount rate (10%) double original = 0.0; double DISC_RATE = 10%; %3D %3D Processing discount int discount 0; %3D Output new price double new price = 0.0; Figure 3-26
Aaron Lakely is going to the grocery store to buy some bananas and apples, both of which are sold by the pound. He wants a program that calculates and displays the total cost of his order, including a 3% sales tax. First, create an IPO chart for this problem, and then desk-check the algorithm
If you use a real number to initialize an int variable, the real number will be _____________________ before it is stored in the variable. a. Demoted b. Promoted c. Reduced d. Upgraded
If memory location’s data type is char, how will it store the character 6? a. 01110110 b. 00110111 c. 00110110 d. None of the above
If a memory location’s data type is int, how will it store the number 54? a. 01110110 b. 00110110 c. 00110111 d. None of the above
Which of the following declares a char named constant called TOP_GRADE? a. Const char TOP_GRADE = 'A'; b. Const char TOP_GRADE = "A"; c. Const char TOP_GRADE; d. Both a and c
Which of the following is a valid name for a variable? a. Amount-sold b. AmountSold c. 1stQtrAmountSold d. Both b and c
Which of the following creates a variable that can store real numbers? a. Double totalDue = '0.0'; b. Double totalDue = 0.0; c. Double totalDue = "0.0"; d. TotalDue = 0.0;
The declaration statement for a named constant requires _____________________ . a. A data type b. A name c. A value d. All of the above
A C++ statement must end with a _____________________ . a. Colon b. Comma c. Period d. Semicolon
Which of the following declares a variable that can store an integer? a. Int quantity = 0; b. Integer quantity = 0; c. Quantity = 0; d. Int quantity = 0;
The rules you must follow when using a programming language are called its _____________________ . a. Guidelines b. Procedures c. Regulations d. Syntax
The algorithm shown in Figure 2-42 should calculate and display the total amount due, but it is not working correctly. Correct the algorithm, and then desk-check it using 20, $0.25, and .045 (the decimal equivalent of 4.5%) as the number of folders purchased, folder price, and sales tax rate,
The payroll clerk at Nosaki Company wants a program that calculates and displays an employee’s gross pay, federal withholding tax (FWT), Social Security and Medicare (FICA) tax, state tax, and net pay. The clerk will enter the hours worked (which is never over 40), hourly pay rate, FWT rate, FICA
Sam wants a program that displays the number of seconds it takes for a baseball to travel a specified distance at a specified speed. The distance will be given in feet, and the speed will be given in miles per hour. Complete an IPO chart for this problem. Desk-check the algorithm using 60.5 feet as
The manager of a local restaurant wants a program that displays the total cost for running a party in the restaurant’s banquet room. The restaurant charges a base fee for renting the room. It also charges a fee per guest. Complete an IPO chart for this problem. Desk-check the algorithm twice,
Carlos receives 24 paychecks each year. Each paycheck, he contributes a specific percentage of his gross pay to his retirement plan at work. His employer also contributes to his retirement plan, but at a different rate. Carlos wants a program that will calculate and display the total annual
Treyson Liu has just purchased his first home. His local flooring store is having a great sale, and he would like to replace the tile floor in his rectangular den with carpeting. He wants a program that calculates and displays the cost of the carpeting. Complete an IPO chart for this problem.
Each time Tania visits the dentist, her dental insurance requires her to pay a $20 co-pay and 15% of the remaining charge. She wants a program that displays the total amount she needs to pay, as well as the total amount the insurance should pay. Complete an IPO chart for this problem. You can
The annual property tax in Richardson County is $1.75 for each $100 of a property’s assessed value. The county clerk wants an application that will display the property tax after he enters the property’s assessed value. Complete an IPO chart for this problem. Desk-check it twice, using your own
An airplane has both first-class and coach seats. The first-class tickets cost more than the coach tickets. The airline wants a program that calculates and displays the total amount of money the passengers paid for a specific flight. Complete an IPO chart for this problem. Desk-check the algorithm
Norbert Catering is famous for its roast beef sandwiches. The store’s owner wants a program that he can use to estimate the number of pounds of roast beef a customer should purchase, given the desired number of sandwiches and the amount of meat per sandwich. Typically, one sandwich requires two
All of the employees at Merks Sales are paid based on an annual salary rather than an hourly wage. However, some employees are paid weekly while others are paid every other week (biweekly). Weekly employees receive 52 paychecks; biweekly employees receive 26 paychecks. The payroll manager wants a
Modify the IPO chart shown earlier in Figure 2-22 so that it also displays the cost per mile driven. Desk-check the algorithm using 324, 17, and $3.10 as the miles driven, gallons used, and cost per gallon of gas. Then desk-check it using 450, 20, and $2.75. Input miles driven Processing
A desk-check table should contain _____________________ . a. One column for each input item b. One column for each output item c. One column for each processing item d. All of the above
The oval in a flowchart is called the _____________________ symbol. a. Calculation b. Input/output c. Process d. Start/stop
The short English statements that represent an algorithm are called _____________________ . a. Flow diagrams b. IPO charts c. Pseudocharts d. Pseudocode
Most algorithms follow the format of _____________________ . a. Entering the input items; then displaying, printing, or storing the input items; and then processing the output items b. Entering the input items; then processing the output items; and then displaying, printing, or storing
The calculation instructions in an algorithm should state _____________________ . a. Only what is to be calculated b. Only how to calculate something c. Both what is to be calculated and how to calculate it d. Both what is to be calculated and why it is calculated
A problem’s _____________________ will answer the question What information will the computer need to know to display, print, or store the output items? a. Input b. Output c. Processing d. Purpose
A problem’s _____________________ will answer the question What does the user want to see displayed on the screen, printed on the printer, or stored in a file? a. Input b. Output c. Processing d. Purpose
Programmers refer to the items needed to reach a problem’s goal as the _____________________ . a. Input b. Output c. Processing d. Purpose
Programmers refer to the goal of solving a problem as the _____________________ . a. Input b. Output c. Processing d. Purpose
Which of the following is the first step in the problem-solving process? a. Plan the algorithm b. Analyze the problem c. Desk-check the algorithm d. Code the algorithm into a program
The algorithm in Figure 1-17 does not get Robin the Robot through the maze. Correct the algorithm. Robin should end up here 1. walk into the maze 2. turn left 90 degrees 3. repeat until (you are directly in front of a wall) walk forward one complete step end repeat 4. turn right go degrees 5.
The algorithm in Figure 1-16 should get Robin the Robot seated in the chair, but it does not work correctly. Correct the algorithm. 4 steps 3 steps 3 steps 1. repeat (3 times) wale forward one complete step end repeat 2. turn left g0 degrees 3. repeat (2 times) walk forward one complete step
Store A is having a BoGoHo (Buy One, Get One Half Off) sale. Store B is not having a sale, but sometimes its prices are much lower than at Store A. Write an algorithm that determines whether it’s cheaper to buy two of the item at Store A or Store B. The algorithm should display either the message
Create an algorithm that tells someone how to evaluate the following expression: 7 * 5 – 20 / 2 + 4 * 2. The / operator means division, and the * operator means multiplication. (As you may remember from your math courses, division and multiplication are performed before addition and subtraction.)
All employees at Kranston Sports Inc. are paid based on an annual salary rather than an hourly wage. However, some employees are paid weekly, while others are paid every other week (biweekly). Employees paid weekly receive 52 paychecks; employees paid biweekly receive 26 paychecks. The algorithm
The algorithm shown in Figure 1-14 should calculate and print the gross pay for five workers; however, some of the instructions are missing from the algorithm. Complete the algorithm. If an employee works more than 40 hours, he or she should receive time and one-half of his or her pay rate for the
Harold is standing in front of a flowerbed that contains six flowers, as illustrated in Figure 1-13. Create an algorithm that directs Harold to pick the flowers as he walks to the other side of the flowerbed. He should pick all red flowers with his right hand. Flowers that are not red should be
Using only the instructions shown in Figure 1-12, write two versions of an algorithm that displays the total amount each customer owes for concert tickets. Be sure to indent the instructions appropriately. calculate the amount owed by multiplying the number of tickets by $35 display the
You have just purchased a new personal computer system. Before putting the system components together, you read the instruction booklet that came with the system. The booklet contains a list of the components that you should have received. The booklet advises you to verify that you received all of
Using only the instructions shown in Figure 1-10, create an algorithm that displays the average of four numbers. Be sure to indent the instructions appropriately. calculate the average by dividing the sum by 4 calculate the sum by adding the number to the sum display the average end repeat
Which control structure would an algorithm use to determine whether a customer is entitled to a senior discount? a. Repetition b. Selection c. Both repetition and selection
A company pays a 3% annual bonus to employees who have been with the company more than 5 years; other employees receive a 1% bonus. Which control structure(s) would an algorithm use to calculate every employee’s bonus? a. Repetition b. Selection c. Both repetition and selection
Which control structure would an algorithm use to calculate a 5% commission for each of a company’s salespeople? a. Repetition b. Selectionc. Both repetition and selection
Which control structure would an algorithm use to determine whether a credit card holder is over his credit limit? a. Repetition b. Selection c. Both repetition and selection
The instruction “If it’s dark, turn the light on” is an example of which structure? a. Control b. Repetition c. Selection d. Sequence
The instruction “Brush your hair 5 times” is an example of which structure? a. Control b. Repetition c. Selectiond. Sequence
The set of step-by-step instructions that solve a problem is called _____________________ . a. An algorithm b. A list c. A pland. A sequential structure
The set of instructions for adding together two numbers is an example of the _____________________ structure. a. Control b. Repetition c. Selectiond. Sequence
Which of the following control structures is used in every program? a. Repetition b. Selection c. Sequenced. Switching
Which of the following is not a programming control structure? a. Repetition b. Selection c. Sequence d. Sorting
Showing 300 - 400
of 378
1
2
3
4
Step by Step Answers