Solved

Pascal Loops

Posted on 2004-10-19
5
412 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
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 50 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 100

Assisted Solution

by:mlmcc
mlmcc earned 20 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 50 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 100

Expert Comment

by:mlmcc
ID: 12363944
Glad I could help

mlcc
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Kind of encoding 3 422
qrdesign delphi 5 pdf 5 449
SHBrowseForFolder - Preselecting a folder 5 270
indy Tidtcpserver best  way to brodcast message to multiable clients 1 155
This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
An article on effective troubleshooting
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

786 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