I have just started a basic class in programming and I am totally lost. Can someone help me out? I have to write pseudocodes and create flowcharts and don't have a clue. I need help.
Create flowcharts and pseudo-code for the following problems:
1. You're trying to figure out where to go on vacation. Here are the different scenarios: First, check how many vacation days you have left. If you have less than 2 days, you will stay at home. If you have between 2 and 4 days, you will go to Asheville. If you have more than 4 days, you check your budget. If your budget is greater than $1200, you will go to Aruba. Otherwise, if it's greater than $800, you will go to Miami. If it's not greater than $800, you will go to Orlando.
2. You need to calculate the discount that your customers receive based on the value of their order. If the total amount ordered is less than $20, no discount will be given. If the total amount is between $20 and $50, a discount of 5% will be given. If the total amount is greater than $50 and less than $100, a discount of 10% will be given. If the total amount is $100 or more, a premium customer receives 20% discount and a regular customer receives 15% discount.
8
Contributors
9
Replies
5 Years
Discussion Span
2 Years Ago
Last Updated
11
Views
Related Article:Pseudo codes help!
is a Computer Science discussion thread by whiplash316 that has 8 replies, was last updated 3 years ago and has been tagged with the keywords: givemetehcodez, homework, lazy, spoonfeeding, student.
I have just started a basic class in programming and I am totally lost. Can someone help me out? I have to write pseudocodes and create flowcharts and don't have a clue. I need help.
Create flowcharts and pseudo-code for the following problems:
1. You're trying to figure out where to go on vacation. Here are the different scenarios: First, check how many vacation days you have left. If you have less than 2 days, you will stay at home. If you have between 2 and 4 days, you will go to Asheville. If you have more than 4 days, you check your budget. If your budget is greater than $1200, you will go to Aruba. Otherwise, if it's greater than $800, you will go to Miami. If it's not greater than $800, you will go to Orlando.
2. You need to calculate the discount that your customers receive based on the value of their order. If the total amount ordered is less than $20, no discount will be given. If the total amount is between $20 and $50, a discount of 5% will be given. If the total amount is greater than $50 and less than $100, a discount of 10% will be given. If the total amount is $100 or more, a premium customer receives 20% discount and a regular customer receives 15% discount.
Hope this helps! it did not stay in the right format you will have to indent some of the lines but I'm sure you know how to do that.
Psuedocode
start
declare variables
VacationDays
BudgetNeeded
print “How many days?
read vacationDays
print “budgetNeeded
read budget
if vacationDays < 2 then
print “Stay at Home
else
if vacationDays > = 2 and < = 4 then
print “Go to Asheville
else
if budgetNeeded >1200 then
print “Go to Aruba
else
if budgetNeeded >800 then
print “Go to Miami
else
print “Go to Orlando
endif
endif
endif
endif
stop
I have just started a basic class in programming and I am totally lost. Can someone help me out? I have to write pseudocodes and create flowcharts and don't have a clue. I need help.
Create flowcharts and pseudo-code for the following problems:
1. You're trying to figure out where to go on vacation. Here are the different scenarios: First, check how many vacation days you have left. If you have less than 2 days, you will stay at home. If you have between 2 and 4 days, you will go to Asheville. If you have more than 4 days, you check your budget. If your budget is greater than $1200, you will go to Aruba. Otherwise, if it's greater than $800, you will go to Miami. If it's not greater than $800, you will go to Orlando.
2. You need to calculate the discount that your customers receive based on the value of their order. If the total amount ordered is less than $20, no discount will be given. If the total amount is between $20 and $50, a discount of 5% will be given. If the total amount is greater than $50 and less than $100, a discount of 10% will be given. If the total amount is $100 or more, a premium customer receives 20% discount and a regular customer receives 15% discount.
Here is # 1
Psuedocode
start
declare variables
VacationDays
BudgetNeeded
print “How many days?
read vacationDays
print “budgetNeeded
read budget
if vacationDays < 2 then
print “Stay at Home
else
if vacationDays > = 2 and < = 4 then
print “Go to Asheville
else
if budgetNeeded >1200 then
print “Go to Aruba
else
if budgetNeeded >800 then
print “Go to Miami
else
print “Go to Orlando
endif
endif
endif
endif
stop
Here is #2
Psuedocode
start
declare variables
num cost, discount
char customerType
printenter cost
get cost
If cost <20 then
discount = 0
else
If cost < 50 then
discount = cost * .05
else
if cost < 100 then
discount = cost * .1
else
print “is customer regular or premium press R for regular press P for premium
get customerType
if “ customerType = “R then
discount = cost *.15
else
discount = cost * .20
endif
endif
endif
endif
print “customer discount is discount
stop
Psuedocode
start
declare variables
VacationDays
BudgetNeeded
print “How many days?
read vacationDays
print “budgetNeeded
read budget
if vacationDays < 2 then
print “Stay at Home
else
if vacationDays > = 2 and < = 4 then
print “Go to Asheville
else
if budgetNeeded >1200 then
print “Go to Aruba
else
if budgetNeeded >800 then
print “Go to Miami
else
print “Go to Orlando
endif
endif
endif
endif
stop
Here is #2
Psuedocode
start
declare variables
num cost, discount
char customerType
printenter cost
get cost
If cost <20 then
discount = 0
else
If cost < 50 then
discount = cost * .05
else
if cost < 100 then
discount = cost * .1
else
print “is customer regular or premium press R for regular press P for premium
get customerType
if “ customerType = “R then
discount = cost *.15
else
discount = cost * .20
endif
endif
endif
endif
print “customer discount is discount
stop