Solved

# Pascal Loops

Posted on 2004-10-19
Medium Priority
427 Views
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:

5 prefer Snowboarding
3 prefer Football
7 prefer Cricket
5 prefer Tennis

plz help???
BTW its not home work its just that i dont understand how to do the number part
0
Question by:Deathondrugs1
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2
• 2

LVL 1

Accepted Solution

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

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

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

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

ID: 12363944

mlcc
0

## Featured Post

Question has a verified solution.

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

The well known Cerber ransomware continues to spread this summer through spear phishing email campaigns targeting enterprises. Learn how it easily bypasses traditional defenses - and what you can do to protect your data.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
###### Suggested Courses
Course of the Month14 days, 15 hours left to enroll