Algorithm Design Document Assignment 1- Oliyad Regasa
.pdf
keyboard_arrow_up
School
Grand Canyon University *
*We aren’t endorsed by this school
Course
INVESTIGAT
Subject
Computer Science
Date
Dec 6, 2023
Type
Pages
2
Uploaded by CorporalRockSalamander39
Assignment xx Algorithmic Design Document
Make a copy before you begin (File -> Make a copy). Add the Assignment # above and
complete the sections below BEFORE you begin to code and submit with your Assignment to
D2L (File -> Download -> PDF). The sections will expand as you type.
Description:
I want to create a program that calculates the amount you should tip at a restaurant.
Sample Program Run:
Hello, I hoped you enjoyed your meal
Enter the price of your order $15.00
Enter what percent you want to tip:%15
Tip: $ 2.25
Sample Algorithmic Design:
a. Identify all of the user input. What are the data types of the inputs? Define the
input variables.
The first input variable is the cost of the meal the user paid for. The second input is
the percentage the user would like to tip their waiter/waitress.
b. Describe the program output. What is displayed to the user? What are the data types
of the output? Define the output variables.
The output to the user is the calculated tip amount.
c. What calculations do you need to do to transform inputs into outputs? List all formulas
needed, if applicable. If there are no calculations needed, state there are no calculations
for this algorithm.
The formula that I will need to use in order to transform my input into an output is Tip=
cost * (percentage/100).
d. Describe the process needed to transform inputs to outputs
using numbered steps
.
Here is where you would use conditionals, loops, functions or array constructs (if
applicable) and explain the process in transforming inputs into outputs.
1. Print a welcome message
2. Prompt user to enter the price of their order to store as variable “cost” 3. Prompt
user to enter the percentage they want to tip to store as variable “percentage” 4.
Calculate Tip=cost * (percentage/100)
5. Print Tip = (calculated variable)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
LAB ASSIGNMENTS
IMPORTANT: you should complete the PDP thinking process for each program. Turn in items:
1) fullname_regex.py - Ask the user to enter the source text to search, such as the name_source variable here:
name_source=input('Enter full name in this format - first middle last').
Then, you can adapt the first two code lines from lesson slide 13, to search this new source. Edit the code to match
the new situation and change the regex pattern to identify text that could be a full name.
Hints: Initially write your regex pattern to check if the user enters three words separated by a space. Then, strive to
make the regex adaptable if the person's full name has more than or less than 3 words. Then, think about allowing!!!
(not requiring) common characters like a period, hyphen or '. Slides 11-13 should be helpful.
For printing, end with a conditional block that provides an appropriate message if there is a match or not.
Match
No Match
Challenge 1
Enter your full name: first middle…
arrow_forward
LAB ASSIGNMENTS
IMPORTANT: you should complete the PDP thinking process for each program. Turn in items:
1) fullname_regex.py - Ask the user to enter the source text to search, such as the name_source variable here:
name_source = input('Enter full name in this format - first middle last').
Then, you can adapt the first two code lines from lesson slide 13, to search this new source. Edit the code to match
the new situation and change the regex pattern to identify text that could be a full name.
Hints: Initially write your regex pattern to check if the user enters three words separated by a space. Then, strive to
make the regex adaptable if the person's full name has more than or less than 3 words. Then, think about allowing
(not requiring) common characters like a period, hyphen or '. Slides 11-13 should be helpful.
08
For printing, end with a conditional block that provides an appropriate message if there is a match or not.
Match
Enter your full name: first middle last Betty Lou Who…
arrow_forward
Average Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)
arrow_forward
PYTHON PROGRAMMING!!
EXTRA CONSTRAINT: MAKE SURE THAT THE CODE ACCEPTS THE INPUT ON THE IMAGE AND OUTPUTS THE RESULT ON THE IMAGE AS WELLYou find yourself in a top-secret mission to infiltrate and disable the nuclear missile silos of a terrorist organization threatening to destroy any country that refuses to surrender. Fortunately, an ally double agent was able to successfully hijack the launch system used by the terrorists. However, in order to not get found out, they could not disable the system outright but they were able to infect the system with an undetectable virus that stops all processes of the system was activated.
Through a secure line, the double agent gives you the instructions in order to activate the virus and stop all missiles from firing:
In the trash can nearest the main computer, you should be able to get a crumpled piece of paper with a grid of random numbers printed onto it. You will know that it is the right piece of paper if there are the same number of rows and…
arrow_forward
Draw flowchart correct of it else downvote.
arrow_forward
Debug this
arrow_forward
Instructions
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
An example of the program is shown below:
Enter credits for first student >> 18 Enter credits for second student >> 30 Total due for student #1 is $1365.1200000000001 Total due for student #2 is $2275.2000000000003
Task 1: The DebugThree4 class compiles without error.
Task 2: The computeTuitionBill() method computes and displays the correct tuition bill.
Task 3: The DebugThree4 program accepts user input and displays the correct output.
arrow_forward
PROGRAMMING PROBLEM
The inventory of a shoe store lists shoes by stock number. With each stock number, there
is associated a style number in the range of 0 to 50, the number of pairs in each size (sizes
range from 3 to 14) and a price. A program is to be written to keep track of the inventory.
The user is given the following choices: enter a new record, display a record, change the
price of the stock item, or change the number on hand. When specifying a record the user
may give either the stock number, or the style number. The array index can be used as a
stock number. If the user decides to change the stock on hand, the program should ask
which sizes will have their stock on hand changed. The program should be designed to
run indefinitely, keeping track of changed in stock.
arrow_forward
2. Big, Bigger, Biggest
by CodeChum Admin
Welcome to a game of Big, Bigger, and Biggest! The
game where we give you three big numbers and
you're going to choose which one is the biggest. Do
your worst!
Input
1. First integer
Constraints
This is guaranteed to be a whole number.
2. Second integer
Constraints
This is guaranteed to be a whole number.
3. Third integer
Constraints
This is guaranteed to be a whole number.
Output
The first line will contain a message prompt to input
the first number.
arrow_forward
Draw flowchart:1.
arrow_forward
Constraints:
Use Python
Don't use global variables
Don't use external libraries (PIL and os are allowed)
Start the program with a main function (def main():)
Content:
Ask the user to input a .jpeg/.jpg image. Once a jpeg file is uploaded, create a function with the argument img_info and return a tuple with the image's dimensions in pixels (w, h) and the image data in a form of a list of tuples with RGB values.
Print out the values/data collected.
arrow_forward
Document2- Word
References
Mailings
Review
View
Tell me what you want to do...
Aa-
AaBbCcDc AaBbCcDc AaBbC AaBbCcC Aa
1 Normal
1 No Spac. Heading 1
Heading 2
Title
Paragraph
Styles
Write a python program that takes a sale amount as an input and
print the discount given based on the table.
Sale Amount
Discount
0-100
2%
101-300
5%
301-600
7%
601-1000
10%
TA
taufeeq ahmed
KAHLAN AL-SUBEIHI
Al Khaili AL Aa
arrow_forward
NUM_CIRCLES = 15
OFFSET = 15
Pensize (inner circle) = 5
Pensize (outer circle) = 2
Circle color = 'blue' # your choice of two colors
fill color (inner circle) = 'yellow'/'red'
Use if statement (see Chapter 3 for syntax)
Use for loop (see Chapter 4 for syntax)
i need the algorithm, python code and ouptu thank you
arrow_forward
Function for button "Publishing Date":
• Name this function by your last name (for example, function yamoutl)).
When the user clicks on the button "Publishing Date" (after filling all the textboxes), the current date and time will be printed after the text "Published on:"
CSCI375 Grades
Exam-1 (70
Exam-2 98
Project 86
Exam-3 80
Show the Grades
Your Grades: Exam-1 - 78, Exam-2 - 98, Project - 85, Exam-3 - 80
Publishing Date
Published on: 5/10/2021, 5:39:08 PM
Change Background Color
arrow_forward
PYTHON PROGRAMMING ASSIGNMENT
PYTHON PROGRAMMING LANGUAGE ASSIGNMENT
Create a new text document called names.txt (this is done by hand - not using programming) with the following names: Adam, Bryan, Charlie. Each name should be followed by a hard return (do not store them in a list).
Main Function. Write a program where the user enters a name. Using the read function, check to see if the name is in the text document. If it is, respond back to the user the name is found within the list.
Read Function. The read function should return the contents of the text document as a list.
Write Function. The write function should take the list and override the file with the new names list in reverse alphabetical order with a hard return after each name.
arrow_forward
Debug this
arrow_forward
Add comments for Program 04
arrow_forward
Instructions
Objectives:
Use a while loop
Use multiple loop controlling conditions
Use a boolean method
Use the increment operator
Extra credit: Reuse earlier code and call two methods from main
Details:This assignment will be completed using the Eclipse IDE. Cut and paste your code from Eclipse into the Assignment text window.
This is another password program. In this case, your code is simply going to ask for a username and password, and then check the input against four users. The program will give the user three tries to input the correct username-password combination.
There will be four acceptable user-password combinations:
alpha - alpha1
beta - beta1
gamma - gamma1
delta - delta1
If the user types in one of the correct username-password combinations, then the program will output: “Login successful.” Here are a couple of example runs (but your code needs to work for all four user-password combinations):
Username: betaType your current password: beta1Login…
arrow_forward
VB Small Project 16 – Function
Pattern this Visual Basic program after Small Project 15:
Main()
Create the random number in the same way.
EvenOrOdd Function()
Pass that number into this function, where it will be found to be either Even or Odd. Return a value indicating which one that will be used back in Main.
DisplayResults Sub
The result from the EvenOrOdd Function is passed into this Sub and the same results as from SP 15 will be printed.
arrow_forward
Assignment
Using a professional tool, create an algorithm to explain how you would solve this problem:
A program reads 3 values from the user and prints the smallest one and the largest one. For example, if the user
enters:
342
The output will be:
The largest number is 4
The smallest number is 2
In the case of duplicates, pick either one.
Submit a JPG of you work
arrow_forward
PYTHON QUESTION
ASSIGNMENT REQUIREMENTS
This assignment requires a dictionary of state abbreviations and their capital cities. The abbreviations are the keys and the state capitals are the values.
Start by entering data for any four states of your choice. Then, report this count but use a function to get the count.
Use a while loop to add more abbreviations and capitals. The loop should continue until the user presses Enter when prompted for an abbreviation.
Inside the while loop:
If the state entered is already in the dictionary, report its capital.
If it is not in the dictionary, prompt the user to enter the capital for that state and add it to the dictionary
After the while loop ends:
Report again the count of the number of states in the dictionary.
Using another loop and the items() method, display all the state abbreviations and their capitals.
In the same Python program write this code, although it has nothing to do with the states code.
Using a dictionary…
arrow_forward
PYTHON PROGRAMMING LANGUAGE
Create a new text document called names.txt (this is done by hand - not using programming) with the following names: Adam, Bryan, Charlie. Each name should be followed by a hard return (do not store them in a list).
Main Function. Write a program where the user enters a name. Using the read function, check to see if the name is in the text document. If it is, respond back to the user the name is found within the list.
Read Function. The read function should return the contents of the text document as a list.
Write Function. The write function should take the list and override the file with the new names list in reverse alphabetical order with a hard return after each name.
EXAMPLEPlease enter a name: AdamAdam is found in the list.Enter another name (Y/N): YPlease enter a name: AndrewSorry, Andrew was not found in the list. Would you like to add it? (Y/N): YAndrew has been added to the list.Enter another name (Y/N): N
LIST EXAMPLEadambryancharlie
Final…
arrow_forward
CREATE A C++ PROGRAM
arrow_forward
CSC1250L
Sample Exam 1
Spring 2020-2021
Write a program that prompts the user to enter the name, the number of children, and the basic salary of an employee.
The program will then:
Calculate the bonus:
Calculate the new salary:
Apply a tax of 10% and find the paid salary:
The program will then display all the information nceded as shown in the sample run below
Sample Run:
Enter the name of the employee: Jamal
Enter the number of children of the employee: 4
Enter the salary of the employee (in $: 1500
The calculated bonus is $100 for 4 children.
The new salary is $1600.0
The paid salary for Jamal is $1 440.0
SONY
arrow_forward
Design the pseudo code that calculates and displays a person's body mass index(bmi) based upon their weight and height. The calculation uses the formula:
bmi = (weight/ (height*height))
psedocode must have proper internal documentation, using block and or line comments. Declare all variables before using them. Pseudo code must illustrate calculations.
arrow_forward
Add comments!Help me prgram this please and thanks!
arrow_forward
Header (.h) files contain all of the declarations of a program. Non-header (.cpp)files contain all the definitions… TRUE OR FALSE
arrow_forward
Character Analysis
Create a source code text file and save it as named text.txt. Write a program that reads the file's contents and determines the following:
- The number of uppercase letters in the file.
- The number of lowercase letters in the file.
- The number of digits in the file.
- The number of whitespace characters in the file.
* Note: Please be sure to use the Python program when creating the program. Thanks!
arrow_forward
#
arrow_forward
PYTHON CODE ONLY WITH PSEUDOCODE PLEASE
arrow_forward
Using Visual Basic 2019
programming language: VB.NET
Franks Software Sales AssignmentYou have been hired by Franks Software Sales to write a program to figure the total cost to customers that order Slappy’s software packages. Discounts are given based on the number of units sold:Number of Units Sold Discount Amount
1–9 None10 – 19 20%
20 – 49 30%
50 – 99 40%100 or more 50%
Create a form similar to this:The three boxes are labels. Remember to use the Auto Size and Border Style properties. The program should read the number of units sold and figure a base cost. The units cost $99 each. A discount should then be figured and subtracted from the base cost. The subtotal, discount amount and total cost should be displayed, as currency, in the appropriate labels.Here are some screen shots of the running program:Set the tab order and access keys.Put comments in your program as to what each section is doing. Use constants for the discount rates and base price.Copy your code and paste it into a…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Related Questions
- LAB ASSIGNMENTS IMPORTANT: you should complete the PDP thinking process for each program. Turn in items: 1) fullname_regex.py - Ask the user to enter the source text to search, such as the name_source variable here: name_source=input('Enter full name in this format - first middle last'). Then, you can adapt the first two code lines from lesson slide 13, to search this new source. Edit the code to match the new situation and change the regex pattern to identify text that could be a full name. Hints: Initially write your regex pattern to check if the user enters three words separated by a space. Then, strive to make the regex adaptable if the person's full name has more than or less than 3 words. Then, think about allowing!!! (not requiring) common characters like a period, hyphen or '. Slides 11-13 should be helpful. For printing, end with a conditional block that provides an appropriate message if there is a match or not. Match No Match Challenge 1 Enter your full name: first middle…arrow_forwardLAB ASSIGNMENTS IMPORTANT: you should complete the PDP thinking process for each program. Turn in items: 1) fullname_regex.py - Ask the user to enter the source text to search, such as the name_source variable here: name_source = input('Enter full name in this format - first middle last'). Then, you can adapt the first two code lines from lesson slide 13, to search this new source. Edit the code to match the new situation and change the regex pattern to identify text that could be a full name. Hints: Initially write your regex pattern to check if the user enters three words separated by a space. Then, strive to make the regex adaptable if the person's full name has more than or less than 3 words. Then, think about allowing (not requiring) common characters like a period, hyphen or '. Slides 11-13 should be helpful. 08 For printing, end with a conditional block that provides an appropriate message if there is a match or not. Match Enter your full name: first middle last Betty Lou Who…arrow_forwardAverage Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)arrow_forward
- PYTHON PROGRAMMING!! EXTRA CONSTRAINT: MAKE SURE THAT THE CODE ACCEPTS THE INPUT ON THE IMAGE AND OUTPUTS THE RESULT ON THE IMAGE AS WELLYou find yourself in a top-secret mission to infiltrate and disable the nuclear missile silos of a terrorist organization threatening to destroy any country that refuses to surrender. Fortunately, an ally double agent was able to successfully hijack the launch system used by the terrorists. However, in order to not get found out, they could not disable the system outright but they were able to infect the system with an undetectable virus that stops all processes of the system was activated. Through a secure line, the double agent gives you the instructions in order to activate the virus and stop all missiles from firing: In the trash can nearest the main computer, you should be able to get a crumpled piece of paper with a grid of random numbers printed onto it. You will know that it is the right piece of paper if there are the same number of rows and…arrow_forwardDraw flowchart correct of it else downvote.arrow_forwardDebug thisarrow_forward
- Instructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter credits for first student >> 18 Enter credits for second student >> 30 Total due for student #1 is $1365.1200000000001 Total due for student #2 is $2275.2000000000003 Task 1: The DebugThree4 class compiles without error. Task 2: The computeTuitionBill() method computes and displays the correct tuition bill. Task 3: The DebugThree4 program accepts user input and displays the correct output.arrow_forwardPROGRAMMING PROBLEM The inventory of a shoe store lists shoes by stock number. With each stock number, there is associated a style number in the range of 0 to 50, the number of pairs in each size (sizes range from 3 to 14) and a price. A program is to be written to keep track of the inventory. The user is given the following choices: enter a new record, display a record, change the price of the stock item, or change the number on hand. When specifying a record the user may give either the stock number, or the style number. The array index can be used as a stock number. If the user decides to change the stock on hand, the program should ask which sizes will have their stock on hand changed. The program should be designed to run indefinitely, keeping track of changed in stock.arrow_forward2. Big, Bigger, Biggest by CodeChum Admin Welcome to a game of Big, Bigger, and Biggest! The game where we give you three big numbers and you're going to choose which one is the biggest. Do your worst! Input 1. First integer Constraints This is guaranteed to be a whole number. 2. Second integer Constraints This is guaranteed to be a whole number. 3. Third integer Constraints This is guaranteed to be a whole number. Output The first line will contain a message prompt to input the first number.arrow_forward
- Draw flowchart:1.arrow_forwardConstraints: Use Python Don't use global variables Don't use external libraries (PIL and os are allowed) Start the program with a main function (def main():) Content: Ask the user to input a .jpeg/.jpg image. Once a jpeg file is uploaded, create a function with the argument img_info and return a tuple with the image's dimensions in pixels (w, h) and the image data in a form of a list of tuples with RGB values. Print out the values/data collected.arrow_forwardDocument2- Word References Mailings Review View Tell me what you want to do... Aa- AaBbCcDc AaBbCcDc AaBbC AaBbCcC Aa 1 Normal 1 No Spac. Heading 1 Heading 2 Title Paragraph Styles Write a python program that takes a sale amount as an input and print the discount given based on the table. Sale Amount Discount 0-100 2% 101-300 5% 301-600 7% 601-1000 10% TA taufeeq ahmed KAHLAN AL-SUBEIHI Al Khaili AL Aaarrow_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 PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning