GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Jun-2005, 16:39
Eager Student Eager Student is offline
New Member
 
Join Date: Jun 2005
Posts: 7
Eager Student is on a distinguished road

Pseudocode


Hi! everyone

I want to design a method that calculates the cost of a semester’s tuition for a college student at Mid-State University. Variables include whether the student is an in-state resident (“I” for in-state, or “O” for out-of-state) and the number of credit hours for which the student is enrolling. The method should throw an exception if the residency code is invalid. Tuition is $75 per credit hour for in-state students and $125 per credit hour for out-of-state students. If a student enrolls in six hours or fewer, there is an additional $100 surcharge. Any student enrolled in 19 hours or more pays only the rate for 18 credit hours.

I need help advice or pseudocode the above.Please help

Eager Student
Last edited by LuciWiz : 03-Jun-2005 at 00:34. Reason: shortened title
  #2  
Old 03-Jun-2005, 03:01
maprich maprich is offline
Member
 
Join Date: May 2005
Posts: 163
maprich has a spectacular aura aboutmaprich has a spectacular aura about
Funny, your description is almost already the pseudo-code you are asking.
But here, if it helps you:
Code:
if h<=6 tf+=100;if h>18 h=18;if(isr) tf+=75*h;else tf+=125*h;
  #3  
Old 03-Jun-2005, 09:38
Eager Student Eager Student is offline
New Member
 
Join Date: Jun 2005
Posts: 7
Eager Student is on a distinguished road
Thank yopu very much
Quote:
Originally Posted by maprich
Funny, your description is almost already the pseudo-code you are asking.
But here, if it helps you:
Code:
if h<=6 tf+=100;if h>18 h=18;if(isr) tf+=75*h;else tf+=125*h;
  #4  
Old 06-Jun-2005, 18:49
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by maprich
Funny, your description is almost already the pseudo-code you are asking.
But here, if it helps you:
Code:
if h<=6 tf+=100;if h>18 h=18;if(isr) tf+=75*h;else tf+=125*h;
Funny your pseudo code looks more like real code, nothing pseudo about it ;-)
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #5  
Old 07-Jun-2005, 01:22
maprich maprich is offline
Member
 
Join Date: May 2005
Posts: 163
maprich has a spectacular aura aboutmaprich has a spectacular aura about
Quote:
Originally Posted by WaltP
Funny your pseudo code looks more like real code, nothing pseudo about it ;-)
yes you are right.. mainly because I also got confused with that pseudo thing. As far as I know there is no standard about what pseudo code should look like. It is just some human readable description about the logic involved in some problem solving. And there is something algorithmic and sequential about pseudo code. Anyway I found it easier to write it with real code syntax.

One thing though - the original poster seemingly doesn't have any experience in programming so real code syntax could be very difficult to understand. Didn't think of that when I posted so this could be more like it:
Code:
If hours is less than 7 then add 100 to fee If hours is more than 18 make hours equal to 18 If is in-state-resident then add (75 * hours) to fee else add (125 * hours) to fee EndIf
  #6  
Old 07-Jun-2005, 10:41
Eager Student Eager Student is offline
New Member
 
Join Date: Jun 2005
Posts: 7
Eager Student is on a distinguished road
Thank you very much man, I highly appreciate.
Eager Student
Quote:
Originally Posted by maprich
yes you are right.. mainly because I also got confused with that pseudo thing. As far as I know there is no standard about what pseudo code should look like. It is just some human readable description about the logic involved in some problem solving. And there is something algorithmic and sequential about pseudo code. Anyway I found it easier to write it with real code syntax.

One thing though - the original poster seemingly doesn't have any experience in programming so real code syntax could be very difficult to understand. Didn't think of that when I posted so this could be more like it:
Code:
If hours is less than 7 then add 100 to fee If hours is more than 18 make hours equal to 18 If is in-state-resident then add (75 * hours) to fee else add (125 * hours) to fee EndIf
  #7  
Old 07-Jun-2005, 14:13
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by maprich
One thing though - the original poster seemingly doesn't have any experience in programming so real code syntax could be very difficult to understand. Didn't think of that when I posted so this could be more like it:
Code:
If hours is less than 7 then add 100 to fee If hours is more than 18 make hours equal to 18 If is in-state-resident then add (75 * hours) to fee else add (125 * hours) to fee EndIf
Yep, that's good pseudo code. It can also be written in code-like manner too:
Code:
if hours < 7 then fee = fee + 100 if hours > 18 then hours = 18 if in-state-resident then fee = fee + (75 * hours) else fee = fee + (125 * hours)
and any of a number of other forms. You may recognize the above is somewhat like BASIC.
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #8  
Old 08-Jun-2005, 13:45
Eager Student Eager Student is offline
New Member
 
Join Date: Jun 2005
Posts: 7
Eager Student is on a distinguished road
Hey man.I have a problem, first I'm student of BSc Computer Science second level measuring with Artificial Intellegence stream in the distance learning Institution, I have no classes for the course I'm self thought everything.My problem is that the lecture the way does her peusodocode is like a syntax, but I do not know, So I just want to look at how she does the pseudocode so that I can learn and practise the way she does, but that can happen if you can give your e-mail address.

Eager Student
Quote:
Originally Posted by WaltP
Yep, that's good pseudo code. It can also be written in code-like manner too:
Code:
if hours < 7 then fee = fee + 100 if hours > 18 then hours = 18 if in-state-resident then fee = fee + (75 * hours) else fee = fee + (125 * hours)
and any of a number of other forms. You may recognize the above is somewhat like BASIC.
  #9  
Old 08-Jun-2005, 14:27
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by Eager Student
Hey man.I have a problem, first I'm student of BSc Computer Science second level measuring with Artificial Intellegence stream in the distance learning Institution, I have no classes for the course I'm self thought everything.My problem is that the lecture the way does her peusodocode is like a syntax, but I do not know, So I just want to look at how she does the pseudocode so that I can learn and practise the way she does, but that can happen if you can give your e-mail address.
This is an extremely confusing post.

Quote:
I'm student of BSc Computer Science
Quote:
I have no classes for the course
Quote:
My problem is that the lecture...
You are in school but don't have any classes, only a lecture? This sounds strange.

Quote:
My problem is that the lecture the way does her peusodocode is like a syntax, but I do not know, So I just want to look at how she does the pseudocode so that I can learn and practise the way she does, ...
OK, you want to learn her way of making psuedo code, so look at how she does psuedo code and ask her questions.

Quote:
... but that can happen if you can give your e-mail address
How can our email address help you understand her pseudo code? She can teach her style better than we can.

Quote:
BSc Computer Science second level measuring with Artificial Intellegence stream in the distance learning Institution
Huh?
Second level => 2nd semester? 2nd year?
measuring with Artificial Intellegence stream => not a clue.
the distance learning Institution => attending school a long way from home?

You obviously aren't a native English speaker. Makes this communication stuff a little difficult... But what happened? Your first post was quite understandable? What was different this time?
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #10  
Old 08-Jun-2005, 15:07
Eager Student Eager Student is offline
New Member
 
Join Date: Jun 2005
Posts: 7
Eager Student is on a distinguished road
Hey! woow!
It seems as if you are dropping a line here.I said I'm at the distance learning Institution that means I'm self thought the lecture is only for the Assignment and final examination , Yes no classes only books and study guide that shows how she does pseudocode but in very cryptic way, That is why I wanted to ask you as the experienced programmer that how I can strive to grasp pseudocoding as well the way the lecture does, Looking at you style pseudocode, serious there are no classes here you can have a look on this url http://www.unisa.ac.za . please could you just continue to help me as an eager student to learn? plaese!!!. I need your -email address so that I can show you what I need?
Quote:
Originally Posted by WaltP
This is an extremely confusing post.




You are in school but don't have any classes, only a lecture? This sounds strange.


OK, you want to learn her way of making psuedo code, so look at how she does psuedo code and ask her questions.


How can our email address help you understand her pseudo code? She can teach her style better than we can.


Huh?
Second level => 2nd semester? 2nd year?
measuring with Artificial Intellegence stream => not a clue.
the distance learning Institution => attending school a long way from home?

You obviously aren't a native English speaker. Makes this communication stuff a little difficult... But what happened? Your first post was quite understandable? What was different this time?
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:29.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.