Project Confusion

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Project Confusion

studentpassingby
This is a question that's a bit off from the usual, but I really need help. ;-;
I'm working with a school project I have and I need help on some things.
The project output goes like this:
Area [A] or Perimeter [P]
//user entered A
Area
Rectangle [R]
Square [S]
Triangle [T]
//user entered R
Rectangle
Enter width:
//user entered 2
Enter length:
//user entered 2
Answer:
4
---
It's pretty much just that, but there's like 3 more shapes.
Here are my questions:
How many String variables should there be?
(choice)
(choice, area, perimeter)
I'm confused about the use of if, else if, and else, where should I put them?
If you choose Area or Perimeter, I know there will be ifs, so do I put if at the (Rectangle, Square, or Triangle) part?

Thanks for taking the time to read this. :)
(i know this is like basic for pros but it def isnt for me)

[/b]




Reply | Threaded
Open this post in threaded view
|

Re: Project Confusion

Alan Cameron
I suggest you write out the steps in normal language that the project must
take.
E.G.
Procedure main
Output Area(A) or Perimeter(P).
Receive user response to Area (A) or Perimeter(P)
If user entered A then do procedure A
If user entered P then do procedure P

Procedure A
Output Rectangle(R) or Square(S) or Triangle(T)
Receive user response to R S or T
If user entered R then do procedure AR
If user entered S then do procedure AS
If user entered T then do Procedure AT
If entry other end project with message wrong input

Procedure P
Output Rectangle(R) or Square(S) or Triangle(T)
Receive user response to R S or T
If user entered R then do procedure PR
If user entered S then do procedure PS
If user entered T then do Procedure PT
If entry other end project with message wrong input

Procedure AR
Output Width?
Receive user input
Store in variable W
Output Length?
Receive user input
Store in variable L
Calculate A = W * L
Output A
End project
...
With similar steps for other procedures

Hope you pass the examinations


-----Original Message-----
From: studentpassingby [mailto:[hidden email]]
Sent: 1 November, 2017 03:57
To: [hidden email]
Subject: [nbusers] Project Confusion

This is a question that's a bit off from the usual, but I really need help.
;-; I'm working with a school project I have and I need help on some things.
The project output goes like this:
Area [A] or Perimeter [P]
//user entered A
Area
Rectangle [R]
Square [S]
Triangle [T]
//user entered R
Rectangle
Enter width:
//user entered 2
Enter length:
//user entered 2
Answer:
4
---
It's pretty much just that, but there's like 3 more shapes.
Here are my questions:
How many String variables should there be?
(choice)
(choice, area, perimeter)
I'm confused about the use of if, else if, and else, where should I put
them?
If you choose Area or Perimeter, I know there will be ifs, so do I put if at
the (Rectangle, Square, or Triangle) part?

Thanks for taking the time to read this. :) (i know this is like basic for
pros but it def isnt for me)

[/b]