Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 tip calculator
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ephraim613




PostPosted: Mon May 04, 2009 8:45 pm   Post subject: tip calculator

What is it you are trying to achieve?
a program that will calculate tips for people (I work in a cafe)


What is the problem you are having?
figuring out how to essentially merge a program that does calculate tips but one person at a time, and the run window is very cluttered, with a program I did years ago when I was learning Turing and understood it better (4 years ago!) that takes n number of students names, grades, averages, and genders and then out puts them into a nice neat grid.


Describe what you have tried to solve this problem
I've tried various copy and pastes of the tip program into the array program with very little success.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
I'll post the tip calculator code here as its short, but the array program will be attached as its 59 lines

Turing:


%calculates the tips for the week for a person
put "Please enter the total amount of tips for the week"
var weektotal : real
get weektotal
loop
    put "Enter the partner's name"
    put "(or number if the name is not available) that is on the sheet,"
    put "then enter the percent as shown on the print out."
    put "Repeat for the next partner"
    var partner : string
    var percent : real
    var tips : real
    get partner, percent
    tips := weektotal * percent
    put "the tips ", partner, " has is $", tips
end loop




Please specify what version of Turing you are using
I'm using v4.1.1



EnterProcedure.t
 Description:
procedure needed for the array program to work properly

Download
 Filename:  EnterProcedure.t
 Filesize:  850 Bytes
 Downloaded:  91 Time(s)


sorting arrays.t
 Description:
the array program from 4 years ago

Download
 Filename:  sorting arrays.t
 Filesize:  1.52 KB
 Downloaded:  98 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
tjmoore1993




PostPosted: Tue May 05, 2009 3:29 pm   Post subject: RE:tip calculator

Please setup a scenario because you are not making sense. When making a small program like this you should use several different variables. You can join them as an array...

Also it helps if you make the problem more specific Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: