[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Pascal Loops

Posted on 2004-10-19
5
Medium Priority
?
434 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
[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
  • Learn & ask questions
  • 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

WooCommerce is becoming the most powerful e-commerce plugin for Wordpress. And why not. The platform comprises of numerous core plugins that may come in handy, powerful options to make your website development task much easier.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 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