We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,390 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Writing pseudo-codes/developing flowcharts

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
Jaguar
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Can anyone help me?

Jaguar
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

hi jaguar.........
its not possible to show the flowchart
but bfore asking for pseudocodes
u shud have shown us what have u
tried by urself

BTW here goes the ist one am writing
it in c.......

#include <stdio.h>
# include<conio.h>
int main()
{
int i,bud; //i=no. of days,bud=budget
printf("enter the no. of days");
scanf("%d",i);
printf("\n enter the budget");
scanf("%d",bud);

if(i<2)
{
    printf("");
}
else
{
   if(i<4)
   {
    printf("");
   }
    else
    {
      if(bud>1200)
     {
       printf("");
     }
      else
       {
            if (bud>800)
             {   printf("");}
            else
              {   printf("");}
       }
    }
}

whoo.............that was
a compex web of if-else

do the second one in the same lines
and check the braces

frank

frankcs
Newbie Poster
13 posts since May 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

Jonie
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

Jonie
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

Jonie
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Developing a flowchart and its pseudocode

trizaliz
Newbie Poster
1 post since Oct 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

can any one help me plz . i want to know that whai is the pseudo code of alll prime numbers from 400 t0 1ooo[/B]

sheikhgeee
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

can you create a flowchart and pseudo code that the output is the sum of the first 10 number ?

diannetots
Newbie Poster
2 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

print 55

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,732 posts since Jun 2005
Reputation Points: 1,153
Solved Threads: 182
Skill Endorsements: 25

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.1061 seconds using 2.67MB