100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Solution manual for C++ Programming From Problem Analysis to Program Design 6th Edition by D.S. Malik R83,44   Add to cart

Exam (elaborations)

Solution manual for C++ Programming From Problem Analysis to Program Design 6th Edition by D.S. Malik

 29 views  0 purchase
  • Course
  • Institution
  • Book

QUESTIONS 1. a. false; b. false; c. true; d. false; e. false; f; false; g. false; h. true; i. true; j. false; k. true; l. false 2. The basic commands that a computer performs are input (get data), output (display result), storage, and performance of arithmetic and logical operations 3. Central...

[Show more]

Preview 3 out of 21  pages

  • January 28, 2022
  • 21
  • 2021/2022
  • Exam (elaborations)
  • Questions & answers
avatar-seller
1

,QUESTIONS
1. a. false; b. false; c. true; d. false; e. false; f; false; g. false; h. true; i. true; j. false; k. true; l. false
2. The basic commands that a computer performs are input (get data), output (display result), storage, and
performance of arithmetic and logical operations
3. Central processing unit (CPU), main memory (MM), and input/output devices.
4. Secondary storage permanently stores programs and data.
5. An operating system monitors the overall activity of the computer and provides services. Some of
these services include memory management, input/output activities, and storage management.
6. The two types of programs are system programs and application programs.
7. In machine language the programs are written using the binary codes while in high-level language the
program are closer to the natural language. For execution, a high-level language program is translated
into the machine language while a machine language need not be translated into any other language.
8. A program written in a high-level language is called a source program.
9. Because the computer cannot directly execute instructions written in a high-level language, a compiler
is needed to translate a program written in high-level language into machine code.
10. A compiler reports syntax errors.
11. Every computer directly understands its own machine language. Therefore, for the computer to execute
a program written in a high-level language, the high-level language program must be translated into the
computer’s machine language.
12. Instructions in a high-level language are closer to a natural language, such as English, and therefore are
easier to understand and learn than machine language.
13. In linking an object program is combined with other programs in the library, used in the program, to
create the executable code.
14. A well-analyzed problem leads to a well-designed algorithm. Moreover, a program that is well
analyzed is easier to modify as well as spot and fix errors.
15. To find the weighted average of the four test scores, first you need to know each test score and its
weight. Next, you multiply each test score with its weight, and then add these numbers to get the
average. Therefore,
1. Get testScore1, weightTestScore1
2. Get testScore2, weightTestScore2
3. Get testScore3, weightTestScore3
4. Get testScore4, weightTestScore4
5. weightedAverage = testScore1 * weightTestScore1 +
testScore2 * weightTestScore2 +
testScore3 * weightTestScore3 +
testScore4 * weightTestScore4;
16. a. Get quarters
b. Get dimes
c. Get nickels
d. Get pennies




2

, e. changeInPennies = quarters * 25 + dimes * 10 + nickels * 5
+ pennies
17. To find the price per square inch, first we need to find the area of the pizza. Then we divide the price
of the pizza by the area of the pizza. Let radius denote the radius and area denote the area of the
circle, and price denote the price of pizza. Also, let pricePerSquareInch denote the price per
square inch.
a. Get radius
b. area = π * radius * radius
c. Get price
d. pricePerSquareInch = price / area
18. To calculate the selling price of an item, we need to know the original price (the price the store pays to
buy) of the item. We can then the use the following formula to find the selling price:
sellingPrice = (originalPrice + originalPrice × 0.80) × 0.90
The algorithm is as follows:
a. Get originalPrice
b. Calculate the sellingPrice using the formula:
sellingPrice = (originalPrice + originalPrice × 0.80) × 0.90
The information needed to calculate the selling price is the original price and the marked-up
percentage.
19. To calculate the area of a triangle using the given formula, we need to know the lengths of the
sides―a, b, and c―of the triangle. Next, we calculate s using the formula:
s = (1/2)(a + b + c)
and then calculate the area using the formula:
area = sqrt(s(s-a)(s-b)(s-c))
where sqrt denotes the square root.
The algorithm, therefore, is:
a. Get a, b, c
b. s = (1/2)(a + b + c)
c. area = sqrt(s(s-a)(s-b)(s-c))
The information needed to calculate the area of the triangle is the lengths of the sides of the triangle.
20. Suppose that billingAmount denotes the total billing amount, numOfItemsOrdered denotes the
number of items ordered, shippingAndHandlingFee denotes the shipping and handling fee, and
price denotes the price of an item. The following algorithm computes and outputs the billing
amount.
a. Enter the number of items bought.
b. Get numOfItemsOrdered
c. billingAmount = 0.0;
d. shippingAndHandlingFee = 0.0;
e. Repeat the following for each item bought.



3

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller brightergrades. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R83,44. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67474 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R83,44
  • (0)
  Buy now