?
Solved

Pascal Loops

Posted on 2004-10-19
5
Medium Priority
?
439 Views
Last Modified: 2011-04-14
How woulld you do this question...

1.      20 students at college were asked which of the following sports they preferred, Snowboarding, Football, Cricket, Tennis.

Write the pseudo code for a program, which displays the following on screen prompts that the user will respond to

      You are student number 1.
      Which sport do you prefer:
(S)nowboarding, (F)ootball, (C)ricket, (T)ennis.

This will be displayed for each student. The program will display the following output the following:

      There were 20 students asked
      5 prefer Snowboarding
      3 prefer Football
      7 prefer Cricket
      5 prefer Tennis

Code your design in Pascal.
plz help???
BTW its not home work its just that i dont understand how to do the number part
0
Comment
Question by:Deathondrugs1
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
kinobestew123 earned 216 total points
ID: 12351418
Hmmm... this is an interesting problem, i presume you would have to somehow use For statements.
0
 
LVL 10

Assisted Solution

by:For-Soft
For-Soft earned 200 total points
ID: 12351936
You have to declare variables:
one to count students, another four to count answers given.

The simplest way to perform yhe task is to create a loop with
for ... to .. do statement.

Inside the loop you can display the question, and count answers.

After the loop ends you can display output part.
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 80 total points
ID: 12354702
I know you say this isn't homework but it is written almost exactly as I would write an assignment to my students.  

Also Pascal is generally used as a teaching tool and has somewhat limited use in the commercial world.

Since you are new to EE welcome.  EE has a policy and it is spelled out in the membership agreement and on the help pages about homework.  We can answer or guide you on specific questions but are not supposed to do the whole problem.

I am not sure what you mean by the number part.  Can you explain which number you don't understand?

mlmcc
0
 
LVL 10

Assisted Solution

by:For-Soft
For-Soft earned 200 total points
ID: 12355848
Pascal has limited use in commercial world because it is generally used as a teaching tool.

Every "good" programmer "has to" do everything in C. So he will not care to check what Pascal can do.

Pascal is easy to mix with assembly, so there is not much things you can't do in Pascal.
Pascal is higher level than C, so it is much easier to understand the code, but little more difficult to use assembly. This is ideal for experiments, when it is necesary to modify the code very often.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12363944
Glad I could help

mlcc
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question