Solved Questions

Solutions
Question
1
solution
Category: Computer Science
In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sides. Write a program that prompts the user to enter the lengths of three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle.
1
solution
Category: Computer Science
A box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies. Write a program that prompts the user to enter the total number of cookies, the number of cookies in a box, and the number of cookie boxes in a container. The program then outputs the number of boxes and the number of containers to ship the cookies. Note that each b...
1
solution
Category: Computer Science
The number in parentheses at the end of an exercise refers to the learning objective listed at the beginning of the chapter. Suppose that overSpeed and fine are double variables. Assign the value to fine as follows: If 0 < overSpeed
1
solution
Category: Computer Science
The number in parentheses at the end of an exercise refers to the learning objective listed at the beginning of the chapter. Suppose that score is an int variable. Consider the following if statements. (3) i. if (score == 70) cout
1
solution
Category: Computer Science
The number in parentheses at the end of an exercise refers to the learning objective listed at the beginning of the chapter. What is the output of the following C++ code? (2, 5 to 6) int x = 15; int y = 3; if (x + y > 17 || y - x < 20) { y = x - y; x = y + x; cout
1 2 3 7