Need Help and you are what i need(C programming HELP)

  • Carbon Copy
  • Born
  • Born
  • Carbon Copy
  • Posts: 2

Post 3+ Months Ago

Ok. so im a freshman in engineering and we have to take a programming class. im not sure why for structural engineering but we have to take it. well i need someone to write me a program in C..not C++ or visual basic but C. we have only learned printf statments and while loops and if statements..i was wondernig if someone can read my assigment and write me a code. im willing to pay..but i would appreciate the help so much.


100 Points Possible
Due February 6th, 11:00pm

Description:

Purdue University, Indiana University, the University of Michigan, the University of Wisconsin, and The Ohio State University are teams that are competing in a race. You are going write a program that determines which of the above teams wins the race.

Each team will enter 3 participants in the race. The first person (the individual winner of the race) to cross the finish line will score 15 points for their team. The second racer to cross the finish line will earn 14 points for their team, the person that finishes last will earn just 1 point for their team.

The official who records the order of finish doesn't have time to type the entire name of the team as each racer finishes. Instead, the official will only record a P for Purdue, I for Indiana, M for Michigan, W for Wisconsin, and O for Ohio State. Sometimes the poor official cannot even hit the shift key, so your program should accept both upper and lower case letters.

After the official enters all of the racers and their order of finish you must print out a list of each team and their team score. You do not need to list the teams in any type of order.

If the official enters an invalid letter you must immediately prompt him to try again. If the official enters too many or too few racers for a team you must print an error message and report no scores.

Our Program: ~cs158/projects/pa1/runpa1

Sample Input/Output

Input Case #1: p, p, p, w, w, w, o, o, o, m, m, m, i, i, i

Output:

Purdue's Score: 42
Ohio State's Score: 24
Michigan's Score: 15
Wisconsin's Score: 33
Indiana's Score: 6

Input Case #2: p, w, p, w, p, w, o, m, o, m, o, m, i, i, i

Output:

Purdue's Score: 39
Ohio State's Score: 21
Michigan's Score: 18
Wisconsin's Score: 36
Indiana's Score: 6

Input Case #3: p, P, P, o, O, o, M, M, M, w, I, W, i, W, i

Output:

Purdue's Score: 42
Ohio State's Score: 33
Michigan's Score: 24
Wisconsin's Score: 12
Indiana's Score: 9

Input Case #4: p, p, p, o, o, o, m, m, m, w, w, w, p, i, i

Output:

One of the teams had less than 3 racers finish, invalid results!

Input Case #5: p, p, P, o, M, M, o, m, O, w, I, x, y, z, w, w, i, a, b, c, I

Output:

Purdue's Score: 42
Ohio State's Score: 28
Michigan's Score: 29
Wisconsin's Score: 13
Indiana's Score: 8

Note, for this case, there are several messages to the user stating that the letter entered is not valid and to try again, this is done during input.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

It's not appropriate to be asking people here to do your school assignments for you.

On the other hand, if you make a serious effort at it and get stuck we might be willing to help you out on a specific problem you're having.
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Posts: 526
  • Loc: St. John's, Newfoundland, Canada

Post 3+ Months Ago

Wait wait! How much is he paying? lol

Ok, seriously. RichB is right. And... if you try, we will help.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Agreed - totally inappropriate.
  • Carbon Copy
  • Born
  • Born
  • Carbon Copy
  • Posts: 2

Post 3+ Months Ago

well here we go..lets see ya debug


include <stdio.h>
include <math.h>


int main()
{
int P = 0;
int I = 0;
int M = 0;
int W = 0;
int O = 0;

printf("Please enter the teams in order of finish,\n P or p for Purdue" \n W or w for Wisonsin \n O or o for Ohio State \n I or i for Indiana \n M or m for Michigan"

for ( int a = 15; a > 0; a-- )
{
char score;
printf( "Please enter team";
scanf(" score %c" ;
while (score != "P" && score != "p" && score != "M" && score != "m" && score != "O" && score != "o" && score != "W" && score != "w" && score != "I" && score != "i" )
{
printf("Invalid choice entered. Please enter again") ;
scan( score);
}
if ( score == "p" || score == "P" )
P = P + a;
if ( score == "i" || score == "I" )
I = I + a;
if ( score == "m" || score == "M" )
M = M + a;
if ( score == "w" || score == "W" )
W = W + a;
if ( score == "o" || score == "O" )
O = O + a;

}
fprint( "Purdue's Score: " %d, P) ;
printf( "Ohio State's Score: " %d, O) ;
printf( "Michigan's Score: " %d, M );
printf( "Wisconsin's Score: " %d, W) ;
printf( "Indiana's Score: " %d, I) ;


return 0;
}

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 83 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.