About   Users   Help
Users & Guests Online
On Page: 1
Directory: 1 & 102
Entire Site: 5 & 947
Page Staff: tgags123, pokemon x, tgags123, supercool22, SonicOlmstead, SonicOlmstead, Barathemos, Furret,
05-13-26 04:37 AM

Forum Links

Thread Information

Views
2,405
Replies
7
Rating
0
Status
CLOSED
Thread
Creator

09-02-08 07:05 AM
Last
Post

09-12-08 08:43 PM
Additional Thread Details
Views: 454
Today: 0
Users: 1 unique

Thread Actions

Thread Closed
New Thread
New Poll
Order
 

Is this correct?

 

09-02-08 07:05 AM
is Offline
| ID: 72123 | 120 Words


JigSaw
Level: 167


POSTS: 790/7936
POST EXP: 584185
LVL EXP: 60574037
CP: 8069.8
VIZ: -46029578

Likes: 0  Dislikes: 0
Began class today and programming is now actually a bit fun now! So I decided to try my own pseudocode out does it look fine? This is not meant to be actually used just to understand logic of processing using pseudocode so there is no quotations or anything. Just wanna know if I am right or close to being right.

input creatureFish
input creatureSnail
input creatureCat
input creatureDog
input creatureSheep
input creatureHorse
input creaturePig
input creatureLlama

creatureFish = 0
creatureSnail = 0
creatureCat = 0
creatureDog = 0
creatureSheep = 1
creatureHorse = 1
creaturePig = 1
creatureLlama = 1

creatureCount = plus one
if creatureSheep, creatureHorse, creaturePig, creatureLlama
else creatureCount = 0

if creatureCount is more than 4
print farm
else
print nofarm
endif



JigSaw Says:
Began class today and programming is now actually a bit fun now! So I decided to try my own pseudocode out does it look fine? This is not meant to be actually used just to understand logic of processing using pseudocode so there is no quotations or anything. Just wanna know if I am right or close to being right.

input creatureFish
input creatureSnail
input creatureCat
input creatureDog
input creatureSheep
input creatureHorse
input creaturePig
input creatureLlama

creatureFish = 0
creatureSnail = 0
creatureCat = 0
creatureDog = 0
creatureSheep = 1
creatureHorse = 1
creaturePig = 1
creatureLlama = 1

creatureCount = plus one
if creatureSheep, creatureHorse, creaturePig, creatureLlama
else creatureCount = 0

if creatureCount is more than 4
print farm
else
print nofarm
endif



--------------------

WEB DESIGN | LOGO DESIGN | HOSTING | DIGITAL IMAGING @ www.SMDIMAGES.com | Layout coded by BigBob85


Vizzed Elite
PHP Developer, Security Consultant

Affected by 'Laziness Syndrome'

Registered: 04-06-06
Location: Area 51
Last Post: 2482 days
Last Active: 2476 days

09-03-08 05:24 AM
BigBob85 is Offline
| ID: 72152 | 138 Words

BigBob85
Level: 153

POSTS: 5849/6381
POST EXP: 217397
LVL EXP: 45087781
CP: 175.7
VIZ: 50268

Likes: 0  Dislikes: 0
Persudo code is ment to be easy to read, aswell as resemble code.

I wouldnt declare variables with input like how you did, unless you ment get input from keyboard..

Its kinda hard to tell what you mean here,

if creatureSheep, creatureHorse, creaturePig, creatureLlama
else creatureCount = 0

If I were to guess, I'd say if its them animals exist, but then you dont have any code there to run if thats true, then you have an else case.. so its kinda confusing.

As for this part,

if creatureCount is more than 4
print farm
else
print nofarm
endif

I would have written it with "> 4", rather than "is more than 4", but your endif is right. Im not sure if theres any presudocode syntax to print stuff to the screen, it can either be print, println, echo, <<, or quite a few things.
Persudo code is ment to be easy to read, aswell as resemble code.

I wouldnt declare variables with input like how you did, unless you ment get input from keyboard..

Its kinda hard to tell what you mean here,

if creatureSheep, creatureHorse, creaturePig, creatureLlama
else creatureCount = 0

If I were to guess, I'd say if its them animals exist, but then you dont have any code there to run if thats true, then you have an else case.. so its kinda confusing.

As for this part,

if creatureCount is more than 4
print farm
else
print nofarm
endif

I would have written it with "> 4", rather than "is more than 4", but your endif is right. Im not sure if theres any presudocode syntax to print stuff to the screen, it can either be print, println, echo, <<, or quite a few things.

BigBob85s Display Picture
Vizzed Elite
Member Of The Year 07


Affected by 'Laziness Syndrome'

Registered: 12-09-04
Location: Melbourne, Australia
Last Post: 2351 days
Last Active: 469 days

09-03-08 09:15 AM
is Offline
| ID: 72158 | 125 Words


JigSaw
Level: 167


POSTS: 792/7936
POST EXP: 584185
LVL EXP: 60574037
CP: 8069.8
VIZ: -46029578

Likes: 0  Dislikes: 0
Thanks a ton bigbob Pointed out a ton of stuff that I missed. This is the example that was used in the class:
----------------------------------------------------
input gramsCarb
input gramsProtein
input gramsFat

fatCalories = gramsFat times nine
carbCalories = gramsCarb times four
proteinCalories = gramsProtein times four
totalCalories = fatCalories plus carbCalories plus proteinCalories

fatPercentage = fatCalories divided by totalCalories

if fatPercentage is less than 0.30
print healthy
else
print unhealthy
endif
----------------------------------------------------
So I basically followed it's path a bit and tried to write my own lol. Oh well, I think I made some decent progress so far, I took 6 weeks of PHP and couldn't even write my own things now only 3 days of programming logic and it's making a lot more sense.




JigSaw Says:
Thanks a ton bigbob Pointed out a ton of stuff that I missed. This is the example that was used in the class:
----------------------------------------------------
input gramsCarb
input gramsProtein
input gramsFat

fatCalories = gramsFat times nine
carbCalories = gramsCarb times four
proteinCalories = gramsProtein times four
totalCalories = fatCalories plus carbCalories plus proteinCalories

fatPercentage = fatCalories divided by totalCalories

if fatPercentage is less than 0.30
print healthy
else
print unhealthy
endif
----------------------------------------------------
So I basically followed it's path a bit and tried to write my own lol. Oh well, I think I made some decent progress so far, I took 6 weeks of PHP and couldn't even write my own things now only 3 days of programming logic and it's making a lot more sense.




--------------------

WEB DESIGN | LOGO DESIGN | HOSTING | DIGITAL IMAGING @ www.SMDIMAGES.com | Layout coded by BigBob85


Vizzed Elite
PHP Developer, Security Consultant

Affected by 'Laziness Syndrome'

Registered: 04-06-06
Location: Area 51
Last Post: 2482 days
Last Active: 2476 days

09-06-08 10:39 AM
iBOCK is Offline
| ID: 72213 | 14 Words

iBOCK
Level: 129


POSTS: 2789/4283
POST EXP: 267468
LVL EXP: 24565167
CP: 839.5
VIZ: 123277

Likes: 0  Dislikes: 0
My brain just melted a little. Time to buy a programming book! *batman music*

Layout Created By BigBob85
lbock3 has sent you an IM
My brain just melted a little. Time to buy a programming book! *batman music*


BlogMySpace PM


FEED MY POKEMAN OR IT'LL DIE!
Aegis Universe progression:
Maps: 40% [ |||| ]
Monsters: 100% [ |||||||||| ]
Weapons: 70% [ ||||||| ]
Spells: 60% [ |||||| ]
Plot: 45% [ |||| ]
Bonus content: 12% [ |` ]
Customization/items: 80% [ |||||||| ]
Want to sign up for the beta test? PM me!

PhotobucketLevel 80+, officially called "Winning" by Dragon master, 2500+ posts.

Vizzed Elite

Affected by 'Laziness Syndrome'

Registered: 05-02-05
Location: the grid
Last Post: 4942 days
Last Active: 3900 days

09-06-08 01:47 PM
is Offline
| ID: 72233 | 31 Words


JigSaw
Level: 167


POSTS: 796/7936
POST EXP: 584185
LVL EXP: 60574037
CP: 8069.8
VIZ: -46029578

Likes: 0  Dislikes: 0
Yeah, I think I did this way wrong now lol. Anyway, I recommend getting a programming logic book first before jumping into coding it it will make a lot more sense


JigSaw Says:
Yeah, I think I did this way wrong now lol. Anyway, I recommend getting a programming logic book first before jumping into coding it it will make a lot more sense

--------------------

WEB DESIGN | LOGO DESIGN | HOSTING | DIGITAL IMAGING @ www.SMDIMAGES.com | Layout coded by BigBob85


Vizzed Elite
PHP Developer, Security Consultant

Affected by 'Laziness Syndrome'

Registered: 04-06-06
Location: Area 51
Last Post: 2482 days
Last Active: 2476 days

09-06-08 10:25 PM
BigBob85 is Offline
| ID: 72243 | 114 Words

BigBob85
Level: 153

POSTS: 5854/6381
POST EXP: 217397
LVL EXP: 45087781
CP: 175.7
VIZ: 50268

Likes: 0  Dislikes: 0
In java, this would look like this.

-----------------------
input gramsCarb
input gramsProtein
input gramsFat

fatCalories = gramsFat times nine
carbCalories = gramsCarb times four
proteinCalories = gramsProtein times four
totalCalories = fatCalories plus carbCalories plus proteinCalories

fatPercentage = fatCalories divided by totalCalories

if fatPercentage is less than 0.30
print healthy
else
print unhealthy
endif
-----------------------
int gramsCarb;
int gramsProtein;
int gramsFat;
// Other code here to prompt user for them values.

int fatCalories = gramsFat * 9;
int carbCalories = gramsCarb * 4;
int proteinCalories = gramsProtien * 4;
int totalCalories = fatCalories + carbCalories + proteinCalories;

double fatPercentage = fatCalories / totalCalories;

if (fatPercentage < 0.3)
{
System.out.println("Healthy.");
}
else
{
System.out.println("Unealthy.");
}
In java, this would look like this.

-----------------------
input gramsCarb
input gramsProtein
input gramsFat

fatCalories = gramsFat times nine
carbCalories = gramsCarb times four
proteinCalories = gramsProtein times four
totalCalories = fatCalories plus carbCalories plus proteinCalories

fatPercentage = fatCalories divided by totalCalories

if fatPercentage is less than 0.30
print healthy
else
print unhealthy
endif
-----------------------
int gramsCarb;
int gramsProtein;
int gramsFat;
// Other code here to prompt user for them values.

int fatCalories = gramsFat * 9;
int carbCalories = gramsCarb * 4;
int proteinCalories = gramsProtien * 4;
int totalCalories = fatCalories + carbCalories + proteinCalories;

double fatPercentage = fatCalories / totalCalories;

if (fatPercentage < 0.3)
{
System.out.println("Healthy.");
}
else
{
System.out.println("Unealthy.");
}

BigBob85s Display Picture
Vizzed Elite
Member Of The Year 07


Affected by 'Laziness Syndrome'

Registered: 12-09-04
Location: Melbourne, Australia
Last Post: 2351 days
Last Active: 469 days

09-10-08 10:52 PM
is Offline
| ID: 72359 | 48 Words


JigSaw
Level: 167


POSTS: 807/7936
POST EXP: 584185
LVL EXP: 60574037
CP: 8069.8
VIZ: -46029578

Likes: 0  Dislikes: 0
Awesome example Basically seems the same as the pseudocode! This week I'm learning bout modules / coupling and cohesion

But I don't get the System.out.println statement, shouldn't it be System.out.printOut or System.in.printOut? Wonder why it would be In kinda confusing lol. Unless the In refers to the input?



JigSaw Says:
Awesome example Basically seems the same as the pseudocode! This week I'm learning bout modules / coupling and cohesion

But I don't get the System.out.println statement, shouldn't it be System.out.printOut or System.in.printOut? Wonder why it would be In kinda confusing lol. Unless the In refers to the input?



--------------------

WEB DESIGN | LOGO DESIGN | HOSTING | DIGITAL IMAGING @ www.SMDIMAGES.com | Layout coded by BigBob85


Vizzed Elite
PHP Developer, Security Consultant

Affected by 'Laziness Syndrome'

Registered: 04-06-06
Location: Area 51
Last Post: 2482 days
Last Active: 2476 days

09-12-08 08:43 PM
is Offline
| ID: 72476 | 6 Words


JigSaw
Level: 167


POSTS: 816/7936
POST EXP: 584185
LVL EXP: 60574037
CP: 8069.8
VIZ: -46029578

Likes: 0  Dislikes: 0
Had a question but solved it


JigSaw Says:
Had a question but solved it

--------------------

WEB DESIGN | LOGO DESIGN | HOSTING | DIGITAL IMAGING @ www.SMDIMAGES.com | Layout coded by BigBob85


Vizzed Elite
PHP Developer, Security Consultant

Affected by 'Laziness Syndrome'

Registered: 04-06-06
Location: Area 51
Last Post: 2482 days
Last Active: 2476 days

(edited by JigSaw on 09-13-08 11:03 PM)    

Page Comments

Dove4JS - 12-12-20 05:26 AM
no image
joldboy70 - 07-10-20 11:13 AM
test
joldboy70 - 07-10-20 11:12 AM
test
savage23157 - 04-08-20 01:33 PM
Hi im new vizzed
zokuza - 11-18-19 09:08 AM
final got playstaion games unlock yes baby digimon world here i com
yoshirulez! - 02-10-17 08:45 PM
MAY MAYS
yoshirulez! - 02-10-17 08:45 PM
maymays
yoshirulez! - 02-07-17 11:13 PM
OwO what's this?
yoshirulez! - 02-07-17 11:13 PM
OwO what's this?
yoshirulez! - 02-07-17 11:13 PM
OwO what's this?

Adblocker detected!

Vizzed.com is very expensive to keep alive! The Ads pay for the servers.

Vizzed has 3 TB worth of games and 1 TB worth of music.  This site is free to use but the ads barely pay for the monthly server fees.  If too many more people use ad block, the site cannot survive.

We prioritize the community over the site profits.  This is why we avoid using annoying (but high paying) ads like most other sites which include popups, obnoxious sounds and animations, malware, and other forms of intrusiveness.  We'll do our part to never resort to these types of ads, please do your part by helping support this site by adding Vizzed.com to your ad blocking whitelist.

×