Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 3, Problem 2PE
Program Plan Intro
Sales Tax
Program Plan:
- Declare a function named “calc()”. This function accepts a parameter named “amt”. Inside the function,
- Assign state sales tax value to the variable “s_salestax”.
- Assign county sales tax value to the variable “c_salestax”.
- Calculate state sales tax and store it in a variable “sstax”.
- Calculate county sales tax and store it in a variable “cstax”.
- Calculate total tax and store it in a variable “totaltax”.
- Calculate total sale and store it in a variable “totalSale”.
- Print the values.
- Inside the “main ()” function,
- Get the amount from the user and store it in a variable “amount”.
- Call the function “calc()” by passing “amount” as the argument.
- Call the main function.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Give me answer
JAVA PROGRAM
In this lab, you will use what you have learned about accumulating totals in a single-level control break program to complete a Java program. The program should produce a report for a supermarket manager to help her keep track of the hours worked by her part-time employees. The report should include the day of the week and the total hours worked by all employees each day. Expected output is attached below.
Instructions
Study the prewritten code to understand what has already been done.
Write the control break code, including the code for the dayChange() method, in the main() method.
Execute this program using the following input values:
Monday – 6 hours (employee 1), 3 hours (employee 2), 4 hours (employee 3)
Tuesday – 4 hours (employee 1), 2 hours (employee 2)
Wednesday – 2 hours (employee 1), 4 hours (employee 2), 6 hours (employee 3)
Thursday – 4 hours (employee 1)
Friday – 3 hours (employee 1), 4 hours (employee 2), 3 hours (employee 3)
Saturday – 7 hours (employee…
Look at the following pseudocode module header:
Module myModule(Integer a, Integer h, Integer c)
Now look at the following call to myModule:
call myModule(3, 2, 1)
When this call executes, the value of will be stored in a, the value of will be stored in b, and the value of will be stored in c.
Chapter 3 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Ch. 3.1 - What is a module?Ch. 3.1 - Prob. 3.2CPCh. 3.1 - Prob. 3.3CPCh. 3.1 - Prob. 3.4CPCh. 3.1 - Prob. 3.5CPCh. 3.2 - In most languages, a module definition has what...Ch. 3.2 - Prob. 3.7CPCh. 3.2 - Prob. 3.8CPCh. 3.2 - Prob. 3.9CPCh. 3.3 - What is a local variable? How is access to a local...
Ch. 3.3 - What is a variables scope?Ch. 3.3 - Prob. 3.12CPCh. 3.3 - Prob. 3.13CPCh. 3.4 - Prob. 3.14CPCh. 3.4 - What are the variables that receive pieces of data...Ch. 3.4 - Prob. 3.16CPCh. 3.4 - Prob. 3.17CPCh. 3.4 - Prob. 3.18CPCh. 3.5 - What is the scope of a global variable?Ch. 3.5 - Give one good reason that you should not use...Ch. 3.5 - Prob. 3.21CPCh. 3 - A group of statements that exist within a program...Ch. 3 - Prob. 2MCCh. 3 - The first line of a module definition is known as...Ch. 3 - Prob. 4MCCh. 3 - Prob. 5MCCh. 3 - A design technique that programmers use to break...Ch. 3 - Prob. 7MCCh. 3 - A _____ is a variable that is declared inside a...Ch. 3 - A(n) ____ is the part of a program in which a...Ch. 3 - A(n) ____ is a piece of data that is sent into a...Ch. 3 - A(n) ____ is a special variable that receives a...Ch. 3 - When _____, only a copy of the argument's value is...Ch. 3 - When ____, the module can modify the argument in...Ch. 3 - A variable that is visible to every module in the...Ch. 3 - When possible, you should avoid using _____...Ch. 3 - The phrase divide and conquer means that all of...Ch. 3 - Prob. 2TFCh. 3 - Module names should be as short as possible.Ch. 3 - Prob. 4TFCh. 3 - A flowchart shows the hierarchical relationships...Ch. 3 - Prob. 6TFCh. 3 - A statement in one module can access a local...Ch. 3 - In most programming languages, you cannot have two...Ch. 3 - Programming languages typically require that...Ch. 3 - Most languages do not allow you to write modules...Ch. 3 - When an argument is passed by reference, the...Ch. 3 - Prob. 12TFCh. 3 - Prob. 1SACh. 3 - Prob. 2SACh. 3 - Prob. 3SACh. 3 - What is a local variable? What statements are able...Ch. 3 - In most languages, where does a local variables...Ch. 3 - What is the difference between passing an argument...Ch. 3 - Prob. 7SACh. 3 - Design a module named timesTen. The module should...Ch. 3 - Examine the following pseudocode module header,...Ch. 3 - Look at the following pseudocode module header:...Ch. 3 - Assume that a pseudocode program contains the...Ch. 3 - Design a module named getNumber, which uses a...Ch. 3 - What will the following pseudocode program...Ch. 3 - What will the following pseudocode program...Ch. 3 - Find the error in the following pseudocode. Module...Ch. 3 - Find the error in the following pseudocode. Module...Ch. 3 - Find the potential error in the following...Ch. 3 - Prob. 4DECh. 3 - Kilometer Converter Design a modular program that...Ch. 3 - Prob. 2PECh. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Prob. 4PECh. 3 - Prob. 5PECh. 3 - Prob. 6PECh. 3 - Calories from Fat and Carbohydrates A nutritionist...Ch. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Prob. 11PE
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
- Programming Language Pragmatics, 4th Editionarrow_forward: Class Diagram for University Admission System Design a University Admission System Class Diagram in which student gets enroll in a semester. The semester has an ID number and there are two kinds of semester, First semester and Second semester, and each semester contains courses. Each course has a title and course Code The course can be registered dropped withdraw by the students. Each student has a name and student number, and there are two kinds of students, Undergraduate Students (for BCS & MCS) and Postgraduate Students (for MPhil & PhD). Each type of students enroll in different ways.arrow_forwardJAVA PROGRAM Introduction The goal of this project is to develop a nontrivial computer program in the Java language by applying elementary programming language concepts learned so far. Specifically, the concepts to be used for this project include simple input/output, selection, iteration (loops), and possibly one-dimensional arrays (although the use of arrays is not required for completing this project). Developing a Java program for printing a calendar Statement of Problem: Develop a Java program to print a calendar for the year that the user will provide as an input to the program. Use the Eclipse IDE (on a Windows or Mac machine). Your program must fulfill the following requirements: Your program should prompt and receive as input an integer value representing the year for which the user wishes to have a calendar printed. This integer must be in the range from 1780 through 2040. In case the user input a year that is outside this range, your program must print out a message such as…arrow_forward
- Question IV: ER Modeling A social recreation club has a system to keep track of club members, committees and activities. Each club has a registration number and a title. Several members form committee. Members are male and females. Each committee has a name, a unique number and a date, which the committee has formed. The system stores the members’ unique identification number, name, address, gender, birth date and club joining date. The club forms committees for different activities. A committee controls and organizes a number of activities, each of which has a unique name, a unique number and description of the event. An event has event ID and description of the event. An activity may consist of several events. Committee publishes many online advertisements about the activities. Advertisement details are ID and a title. Draw the ER diagram to represent the above scenarioarrow_forward-. The popular expression "Divide-And-Conquer" refers to a kind of A Top-down design B Object oriented design C Algorithmic design D Modular designarrow_forwardJava code The Seattle Party Cruise Company owns a fleet of boats that they use to host parties on Lake Washington and Lake Union. A customer books a boat for an evening event, and the company provides the sailing and serving crew and all the necessary food and drink for the event. The customer tells the company how many people will be attending, and the company must calculate how much food and drink to purchase and bring on board for the evening. The problem is that the company's employees have been calculating badly, sometimes running out before the end of the evening, and sometimes ending up with a lot left over. So, you have been hired by the Seattle Party Cruise Company to write a program to help employees properly stock their cruise boats for any given event. You need to write a command-line program that asks the employee how many adults, teenagers, and children will be attending the event. The program should then calculate how many soft drinks, glasses of champagne, slices of…arrow_forward
- What does "modify a design" really mean?arrow_forwardBuilding Arena models: A few years ago, I was in a group involved with building industrial facilities. A team of consultants visited us to make a presentation about improving the building process. They had a demonstration in the form of a game. We were divided into two teams of four and sat four in a row at a table. Person 1 was given 100 poker chips. The game process was Person 1 would roll a single die. Whatever the number was, he or she would pass that number of chips to Person 2. Person 2 would roll the die, and • If the number of the roll is less than or equal to the chips in front of Person 2, the number of the die roll is passed to the next person. Any remaining chips stay in place, to be passed on another turn when possible.• If the roll on the die is greater than the number of the chips in front of Person 2, all the chips are passed, but the difference in what could be passed is lost on that turn. For example, if Person 2 has 3 chips and rolls a “1,” then one chip is passed.…arrow_forward4arrow_forward
- int main() { E(); C(); E(); } void B() {...} void C() {...} void D() {...} void E() { B(); D(); } Which describes the order in which the functions are called when the program is run?arrow_forwardCar Service MaintenanceCreate a program for car service maintenance. Based on numbers of months / distance travelled, the system will recommend for doing service as well as the parts to be changed. Finally, the system may generate the cost of service and items to be replaced. Hint# You can input the car model, owner name, number of months and distance travelled. Create a service schedule. For example, Servicing after every 10,000 km travelled or 6 months whichever comes first. The system should then generate the cost of service and items to be replaced. Use a random generator to generate the invoice number which is the combination of the date and the random number. (Hint# https://docs.python.org/3/library/random.html)Use appropriate prompts to input data and to present the output.Make sure you have the ID and name mentioned in the Jupyter Notebook or Python fileUpload the jupyter doc, python code in the link providedarrow_forwardASSIGNMENT Understand the pay structure of an IT company. An employee gets basic salary and allowances Travelling allowance (8%), Dearness allowance (20%), Medical (10%), Family (5%), Relocation allowance (6%). Calculate the gross salary he is getting including above mentioned allowances. Also, he is paying 13% GST (tax) for each pay period. Can you calculate NET salary which he receives after these deductions? DESIGN: ALGORITHM AND FLOW CHARTarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ 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 Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
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 Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning