Solved

Pascal Loops

Posted on 2004-10-19
5
404 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 54 total points
Comment Utility
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 50 total points
Comment Utility
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 100

Assisted Solution

by:mlmcc
mlmcc earned 20 total points
Comment Utility
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 50 total points
Comment Utility
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 100

Expert Comment

by:mlmcc
Comment Utility
Glad I could help

mlcc
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi Canvas.Draw explaination.... 8 4,313
Determine Drive Types 2 469
HTTP-POST Delphi 7 5 2,720
ddeman not working in activex 3 78
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now