Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134443850
Author: GADDIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 1, Problem 35RQE
The variable a starts with the value 1.
The variable b starts with the value 10.
The variable c starts with the value 100.
The variable x starts with the value 0.
Store the value of c times 3 in x.
Add the value of b times 6 to the value already in x.
Add the value of a times 5 to the value already in x.
Display the value in x on the screen.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
((PYTHON))
Q1- Ask the user to write a number 8 times. Find the sum and the average of all those numbers then display for the user the answer of both the sum and the average.
Q2- Ask the user to guess what your favorite color is. If he does not answer correctly, ask him if he wants to try again. If he does not want to try again, display for him the correct answer.
A piece of wire is to be bent in the form of a circle to put around a picture frame.Write a program that prompts the user to input:The length of the wireThe program then outputs:the radius and area of the circle.You may assume that π = 3.1416. Declare PI as a named constant with this value.
Code this with visual studio.
The variable x starts with the value 0.The variable y starts with the value 5.Add 2 to X.Add 2 to y.Add x and y, and store the result in y.Display the value in y on the screen.
Chapter 1 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Ch. 1.2 - Why is the computer used by so many different...Ch. 1.2 - List the five major hardware components of a...Ch. 1.2 - Internally, the CPU consists of what two units?Ch. 1.2 - Prob. 1.4CPCh. 1.2 - Prob. 1.5CPCh. 1.2 - Prob. 1.6CPCh. 1.2 - Prob. 1.7CPCh. 1.2 - Prob. 1.8CPCh. 1.2 - What do you call a program that performs a...Ch. 1.2 - Word processing programs, spreadsheet programs,...
Ch. 1.3 - What is an algorithm?Ch. 1.3 - Why were computer programming languages invented?Ch. 1.3 - Prob. 1.13CPCh. 1.3 - Prob. 1.14CPCh. 1.3 - Prob. 1.15CPCh. 1.3 - Prob. 1.16CPCh. 1.3 - Prob. 1.17CPCh. 1.5 - Prob. 1.18CPCh. 1.5 - Prob. 1.19CPCh. 1.5 - Describe the difference between a program line and...Ch. 1.5 - Prob. 1.21CPCh. 1.5 - What happens to a variables current contents when...Ch. 1.5 - What must take place in a program before a...Ch. 1.5 - Prob. 1.24CPCh. 1.7 - What four items should you identify when defining...Ch. 1.7 - Prob. 1.26CPCh. 1.7 - What is a hierarchy chart?Ch. 1.7 - Prob. 1.28CPCh. 1.7 - Describe what a compiler does with a programs...Ch. 1.7 - Prob. 1.30CPCh. 1.7 - Is a syntax error (such as misspelling a key word)...Ch. 1.7 - What is the purpose of testing a program with...Ch. 1.7 - Briefly describe the difference between procedural...Ch. 1 - Prob. 1RQECh. 1 - What is the difference between system software and...Ch. 1 - Prob. 3RQECh. 1 - Why must programs written in a high-level language...Ch. 1 - Why is it easier to write a program in a...Ch. 1 - Prob. 6RQECh. 1 - Prob. 7RQECh. 1 - Prob. 8RQECh. 1 - The job of the ________ is to fetch instructions,...Ch. 1 - Internally, the CPU consists of the _______ and...Ch. 1 - Prob. 11RQECh. 1 - The two general categories of software are...Ch. 1 - A program is a set of _______.Ch. 1 - Prob. 14RQECh. 1 - _______ is the only language computers really...Ch. 1 - __________ languages are close to the level of...Ch. 1 - ________ languages are close to the level of the...Ch. 1 - Prob. 18RQECh. 1 - Words that have special meaning in a programming...Ch. 1 - Prob. 20RQECh. 1 - Prob. 21RQECh. 1 - __________ characters or symbols mark thebeginning...Ch. 1 - Prob. 23RQECh. 1 - Prob. 24RQECh. 1 - Prob. 25RQECh. 1 - Prob. 26RQECh. 1 - __________ is information a program gathers from...Ch. 1 - __________is information a program sends to the...Ch. 1 - Prob. 29RQECh. 1 - Available Credit The following steps should be...Ch. 1 - Sales Tax Design a hierarchy chart or flowchart...Ch. 1 - Account Balance Design a hierarchy chart or...Ch. 1 - The variable x starts with the value 0. The...Ch. 1 - The variable j starts with the value 10. The...Ch. 1 - The variable a starts with the value 1. The...Ch. 1 - Find the Error 36. The following pseudocode...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Distinguish among data definition commands, data manipulation commands, and data control commands.
Modern Database Management (12th Edition)
What is the output produced by the following (when embedded in a correct program with x declared to be of type ...
Problem Solving with C++ (9th Edition)
Pennies for Pay Design a program that calculates the amount of money a person would earn over a period of time ...
Starting Out with Programming Logic and Design (4th Edition)
Using an example of a component that implements an abstract data type such as a stack or a list, show why it is...
Software Engineering (10th Edition)
Would the program in Display 12.8 behave any differently if you replaced the using directive using namespace dt...
Problem Solving with C++ (10th Edition)
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- programs expressed as English statements. What would each displayon the screen if they were actual programs? The variable x starts with the value 0.The variable y starts with the value 5.Add 1 to x.Add 1 to y.Add x and y, and store the result in y.Display the value in y on the screen.arrow_forwardA room needs to be painted that has four walls. The room is rectangular in shape. All four walls are the same height. Two of the walls on the opposite side of each other have the same length. The other two walls on the opposite side of each other have the same width. Paint is purchased based on the amount of square footage that needs to be painted. Assume the room has a standard flat ceiling (no angles nor cathedral ceiling). Input the height, length, and width measurements in feet. Calculate and output each of the following: The square feet of walls need to be painted The square feet of ceiling needs to be painted After calculating the walls square footage and the ceiling square footage, determine which of the two square footages is larger and display which of the two is the larger square footage with an appropriate message stating which one is the larger square footage. (use a sequential structure and a decision structure)arrow_forwardPretend that you have just opened a new savings account that earns 4 percent interest per year. The interest that you earn is paid at the end of the year and is added to the balance of the savings account. Write a program that begins by reading the amount of money deposited into the account from the user.Then your program should compute and display the amount in the savings account after 1, 2, and 3years. Display each amount so that it is rounded to 2 decimal places.arrow_forward
- Using the calculator program that you designed previously, add the functionality for the following buttons:C will clear the label.will add sqrt( to the label.x^y will add ^ to the label.% will add % to the label.LOG will add log( to the label.Will add value 3.14159... to the label.= will evaluate the expression. User will be notified of any syntax or division by 0 error. Note: For square root symbol, copy √ and paste it in the text of the button.For Π symbol, use text=u"\u220f" in the definition of the button. The code I want to add the functions in: from tkinter import * window=Tk()window.title("Calculator")lbl1=Label(text="",width=15,bg="#40E0D0")lbl1.place(x=0,y=10)window.resizable(False,False) btn1=Button(text=" C ")btn1.place(x=0,y=40) btn2=Button(text=" √ ")btn2.place(x=35,y=40) btn3=Button(text="x^y")btn3.place(x=72,y=40) btn4=Button(text=" % ")btn4.place(x=115,y=40) btn5=Button(text=" 1 ")btn5.place(x=0,y=85) btn6=Button(text=" 2 ")btn6.place(x=35,y=85) btn7=Button(text=" 3…arrow_forward5. The variable j starts with the value 10. The variable k starts with the value 2. The variable l starts with the value 4. Store the value of j times k in j. Store the value of k times l in l. Add j and l, and store the result in k. Display the value in k on the screen. 6. The variable a starts with the value 1. The variable b starts with the value 10. The variable c starts with the value 100. The variable x starts with the value 0. Store the value of c times 3 in x. Add the value of b times 6 to the value already in x. Add the value of a times 5 to the value already in x. Display the value in x on the screen. 7. area = width × length. Display “What is the room’s width?”. Input width. Display “What is the room’s length?”. Input length. Display area.arrow_forwardprograms expressed as English statements. What would each displayon the screen if they were actual programs? The variable j starts with the value 10.The variable k starts with the value 2.The variable l starts with the value 4.Store the value of j times k in j.Store the value of k times l in l.Add j and l, and store the result in k.Display the value in k on the screen.arrow_forward
- Java program: Please help me with this, I want the code without the if statement, and the variables names should be a,b,x,y thank you so mucharrow_forwardDeclare five variables a, b, c, d, e, and f. Assign a a number literal between 5 and 15 and assign b a different number literal between 5 and 15. Assign c the String literal value "Adam" and assign d the String literal value "Bob". Assign e the boolean literal true and f the boolean literal false. Report the results of performing the following calculations: a + b a + c a + e a + f c + d c + e c + f e + f a / b a % b a / c a / e a / f a > b a < b c > d c < d a > c a < c b < f b > f e == 1 f == 0 e == "" f == ""arrow_forwardBasic data types, keyboard input and conditional statements The front tires of a car should both have the same pressure. Also, the rear tires of a car should both have the same pressure (but not neccessarily the same pressure as the front tires.) Write an interactive program that gets from the keyboard the pressure of the four tires and writes a message that says if the inflation is OK or not and also displays the average pressure of all the tires. Input right front pressure 38 Input left front pressure 38 Input right rear pressure 42 Input left rear pressure 42arrow_forward
- Type a code in the Visual Basic program. You have 1 Command 2 Text 1 Sheep. When you enter the length in Text 1 and the width in Text 2 the gray size changes. Use the 2008 versionarrow_forwardFill in the blank question: Q. M3G is also known as _______________ Graphics.arrow_forwardPlease use Visual Studio or Xcode to create a program that asks user giving you the amount of money customer has spent, your program will determine how much percent of discount the customer will receive: If the amount is more than $300, the discount is 30%; If the amount is more than $200 but less than $300, the discount is 20%; If the amount is more than $100 but less than $200, the discount is 10%; If the amount is less than $100, the discount is 5%; Based on the inputted amount value, your program will print out. the discount percent, the discount amount, the invoice total You will be using C++ for this programarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY