Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2.3, Problem 2.5CP
On paper, write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
3. Write a program that resembles a phone book, which stores and displays the names,
the addresses (cities) and the telephone numbers for 10 people.
Homework
1. Write a program to have the user guess a number stored in the program. If he
guesses right, tell him so. If he guesses wrong also tell him.
2. Write a program with a user interface which allows the user to enter 2
integers. It should then give him the option of adding them, subtracting them,
multiplying them or dividing them. It should then print the result.
3. Write a program with a user interface to allow a user to enter a number and to
tell him whether the number is even or odd. Use the truncating property of int
to do this.
4. Write a program with a user interface which allows the user to enter two
numbers. Check if the first number is a multiple of the second number. If it is
tell the user; if it isn't tell him also.
5. Write a program in which the user inputs a letter and you print it back
If the letter is already
t it cap
again for him.
6. Same a previous question, only this time if it is capital, print it lowercase.
7. Let the user enter 3 numbers. Print the numbers…
Write a python program that draws a rectangle filled with random colors horizontally. Let the user enter the side and width of the rectangle (hint: use a random number generator to set the pen rgb color value).
Chapter 2 Solutions
Starting Out With C++: Early Objects (10th Edition)
Ch. 2.1 - The following C++ program will not compile because...Ch. 2.1 - On paper, write a program that will display your...Ch. 2.3 - Prob. 2.3CPCh. 2.3 - What output will the following lines of code...Ch. 2.3 - On paper, write a program that will display your...Ch. 2.5 - Which of the following are legal C++ assignment...Ch. 2.5 - List all the variables and literals that appear...Ch. 2.5 - When the above main function runs, what will...Ch. 2.5 - When the following main function runs, what will...Ch. 2.7 - Which of the following are illegal C++ variable...
Ch. 2.7 - Prob. 2.11CPCh. 2.7 - Prob. 2.12CPCh. 2.7 - Prob. 2.13CPCh. 2.7 - How would you combine the following variable...Ch. 2.7 - How would you combine the following variable...Ch. 2.8 - Prob. 2.16CPCh. 2.8 - What will the following code display? int number;...Ch. 2.8 - Prob. 2.18CPCh. 2.10 - Prob. 2.19CPCh. 2.10 - Which of the following is a character literal? 'B'...Ch. 2.10 - Prob. 2.21CPCh. 2.10 - What is wrong with the following program...Ch. 2.10 - Prob. 2.23CPCh. 2.10 - Write a program that stores your name, address,...Ch. 2.15 - Is the following assignment statement valid or...Ch. 2.15 - What is wrong with the following program? How...Ch. 2.15 - What will be assigned to x in each of the...Ch. 2.15 - Prob. 2.28CPCh. 2 - Every complete statement ends with a _____.Ch. 2 - To use cout statements you must include the _____...Ch. 2 - Every C++ program must have a function named...Ch. 2 - Prob. 4RQECh. 2 - A group of statements, such as the body of a...Ch. 2 - 'A', and "Hello World" are all examples of _____.Ch. 2 - 978.65 1012 would be written in E notation as...Ch. 2 - Prob. 8RQECh. 2 - Write a C++ statement that defines the double...Ch. 2 - Write a C++ statement that defines the int...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Modify the following program segment so it prints...Ch. 2 - Rewrite the follow statement to use the newline...Ch. 2 - Create detailed pseudocode for a program that...Ch. 2 - Prob. 24RQECh. 2 - Prob. 25RQECh. 2 - Create detailed pseudocode for a program that...Ch. 2 - What will the following programs print on the...Ch. 2 - A) #include iostream using namespace std; int main...Ch. 2 - The following program contains many syntax errors....Ch. 2 - Soft Skills Programmers need good communication...Ch. 2 - Sum of Two Numbers Write a program that stores the...Ch. 2 - Sales Prediction The East Coast sales division of...Ch. 2 - Sales Tax Write a program that computes the total...Ch. 2 - Restaurant Bill Write a program that computes the...Ch. 2 - Miles per Gallon A car holds 16 gallons of...Ch. 2 - Distance per Tank of Gas A car with a 20 gallon...Ch. 2 - Number of Acres One acre of land is equivalent to...Ch. 2 - Land Calculation In the United States, land is...Ch. 2 - Prob. 10PCCh. 2 - Triangle Pattern Write a program that displays the...Ch. 2 - Diamond Pattern Write a program that displays the...Ch. 2 - Pay Period Gross Pay A particular employee earns...Ch. 2 - Basketball Player Height The star player of a high...Ch. 2 - Energy Drink Consumption A soft drink company...Ch. 2 - Past Ocean Levels The Earths ocean levels have...Ch. 2 - Future Ocean Levels During the past decade ocean...Ch. 2 - Annual High Temperatures The average July high...Ch. 2 - How Much Paint A particular brand of paint covers...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Give the name of the algorithm that results from each of the following special cases: a. Local beam search with...
Artificial Intelligence: A Modern Approach
Consider the adage Never ask a question for which you do not want the answer. a. Is following that adage ethica...
Experiencing MIS
What is the meaning of \n as used in the following statement (which appears in Display 1.8)? cout Enter the nu...
Problem Solving with C++ (9th Edition)
How does a file buffer increase a programs performance?
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Write SQL data definition commands for each of the following queries: How would you add an attribute, Class, to...
Modern Database Management
The keywordindicates that a method does not return a value.
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
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
- Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your classes and your friends and to ask for money; you might write to a friend about your love life, your classes, and your hobbies; and you might write to your brother about your hobbies and your friends and to ask for money. Write a program that prints similar letters such as these to three people of your choice. Each letter should have at least one paragraph in common with each of the other letters. Your main program should have three method calls, one for each of the people to whom you are writing. Try to isolate repeated tasks into methods.arrow_forwardwrite a program that displays, in ascending order,the first names of those students who have attended more than one day of the course.If there are students with the same first name, display their first and last names.arrow_forwardAssume that a gasoline company has a computer facility to take care of billing customers when they buy gasoline with credit cards. The computer is used to make out the check to the station, prepare a master list and create mailing lists and bills. Each customer's information is punched on the card, which contains the gas station number and name, the customer's number and name, and certain billing codes. Can you think of any things that could happen that would make the program useless?arrow_forward
- Write a program that asks for two numbers. After the input of two numbers, ask the user whatoperation to do between the numbers. Perform the operation according to the user’s choice and displaythe result. After the display, ask the user if he wants to continue. If the user continues, ask for a numberand an operation. Perform the selected operation with the recent result and the new input value. Displaythe result according to the user’s choice and ask the user again if he wants to continue. Repeat thisprocess as long as the user wants to continue.When selecting an operation, it must be case sensitive. If the user provides an invalid input in selectingan operation, display an error message and ask again for an operation. The program must not exit. Theprogram will only terminate after the user select not to continue.arrow_forwardWrite a program to simulate a bank transaction. As the banker, create a single pin number for all customer that enter the bank (a constant variable). You are now ready for customer transactions. Prompt the customer for their name and pin number. If the pin number does not match your banker pin number, then they are not a valid customer. Send them away. If the customer is a valid customer, there are two bank accounts: checking and savings. First, ask for the initial balances of the bank accounts; reject negative balances. Then ask for the transactions; options are deposit, withdrawal, and transfer. Then ask for the account; options are checking and savings. Then ask for the amount; reject transactions that overdraw an account. At the end, display the balances of both accounts (using printf) to two decimal places and with a leading dollar sign.arrow_forwardWrite a Python application for the following scenario. You have some students in your Introduction to Python Programming class. Write an interactive program that asks the user to input the names of each student and then their grades. Each student inputs three grades (Exam 1, 2 and 3 (you can create categories of your choice)). Calculate the total scores of each student. With the data that you have collected, please create a graph (pie chart or column charts) with the information of your students. Try to use data labels for your program. Please follow the rubric and submit everything as required. Hint: Use any of the concepts that you have learnt through the course. You can use methods, lists, or anything that you would find necessary to create the solution.arrow_forward
- Write a program called yourname, Christmas Tree.cpp. Write a program that ask how many rows(levels) of Christmas tree the user wants to print, and the user can see a Christmas tree (tree part with the rows they input) on the screen. You can design how large the base of the Christmas tree will be and the position of this Christmas tree shown on the screen (The reference outputs show below). 10 rows tree part. Base part 4 rows tree part. Base part Christmas Tree Program How many levels Christmas tree you want to get: 10 ******** **** Christmas Tree Program How many levels Christmas tree you want to get: 4 ******* ***arrow_forward1. Write a program that prints your full name. Write a program that prints your full name using asterisk(*). Write a program that prints a square, a rectangle and a triangle using asterisk. Write a program that adds THREE(3) numbers. Write a program that multiply THREE(3) numbers. Write a program that divides TWO(2) numbers.arrow_forwardHaving a secure password is a very important practice, when much of our information is stored online. Write a program that validates a new password, following these rules:• The password must be at least 8 characters long.• The password must have at least one uppercase and one lowercase letter• The password must have at least one digit.Write a program that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. Your program should include a method that checks whether a password is valid.iCollege Submission and Garrow_forward
- Write a program to divide the original image into 8 sections and displaying it in a separate figure?arrow_forwardIn Java: Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName, and whose output is: lastName, firstName middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, Pat S. If the input has the form firstName lastName, the output is lastName, firstName. Ex: If the input is: Julia Clark the output is: Clark, Julia import java.util.Scanner; public class LabProgram {public static void main(String[] args) {arrow_forwardWrite a program that asks users when their birthday is. Use information provided to give them their astrological sign. Each of the twelve signs should display a different horoscope. Use the following dates for each sign, keeping in mind that both month and day must be evaluated for an accurate result. Aries: March 21–April 20 Taurus: April 21–May 21 Gemini: May 22–June 21 Cancer: June 22–July 22 Leo: July 23–August 22 Virgo: August 23–September 23 Libra: September 24–October 23 Scorpio: October 24–November 22 Sagittarius: November 23–December 21 Capricorn: December 22–January 20 Aquarius: January 21–February 19 Pisces: February 20–March 20arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY