Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-23-2012, 12:15 PM   PM User | #1
JadeEyes
New to the CF scene

 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JadeEyes is an unknown quantity at this point
Need help student urgent

Hello..!!

For the past 2 weeks due to medical problems, i was unable to attend my courses at University. Yesterday,while checking my university mail, I saw that assignment. I've got this computer programming work to be submitted online today at latest midnight, i.e, 7 hours left, to complete this work.

Given I was absent in class, I completely lost for the two last question. When I saw them, I was like "WTF! Did we do that in class!!". I'm still a first year student. So, i'm still a beginner in program design. I'm used to using the <stdio.h> library. I'm usin Dev C++.

If possible please explain the logic behind the codes used.

Please Help..!!

I'd be really grateful.

Here they are:

According to University regulations, the following mapping between a student’s final mark and the indicative classification of degree is provided for guidance of the board of examiners.

>= 70 First Class Honours
60-69 Upper Second Class Honours
50-59 Lower Second Class Honours
40-49 Third Class Honours
<40 Not an honours degree

(There are other regulations that affect the degree classification.)

Write a program to prompt the user to enter a mark as a floating point number. Check that the mark is in the range 0.0 – 100.0 and, if it is, display the indicative degree classification according to the mapping above and if not, then display a message saying that the marks input is invalid.

Test your program to ensure that the mapping is correct.


Next one:

The UK sequence of traffic lights is:
"Red" (means stop); this is followed by:
"Red and Amber" (means prepare to go); this is followed by:
"Green" (means go); this is followed by:
"Amber" (means prepare to stop); this is followed by:
"Red"; etc..
Write a program that prompts the user to enter the current state of a traffic light, then displays the next state.

For example, if the current state is "Red and Amber", the next state is "Green".

Use a menu system to obtain the current.



Thank You..!!
JadeEyes is offline   Reply With Quote
Old 09-23-2012, 04:10 PM   PM User | #2
JadeEyes
New to the CF scene

 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JadeEyes is an unknown quantity at this point
For question 4,

#include<iostream.h>

void main()

{

float num;

cout<<"Enter marks:"<<endl;

cin>>num;

if(num>=0.0 && num<=100.0)

{

if(num>=70.0)

cout<<"First Class Honours";

else if(num>=60.0 && num<70.0)

cout<<"Upper Second Class Honours";

else if(num>=50.0 && num<60.0)

cout<<"Lower Second Class Honours";

else if(num>=40.0 && num<50.0)

cout<<"Third Class Honours";

else if(num<40.0)

cout<<"Not an honours degree";

}

else

{

cout<<"Marks input is invalid";

}

}


Is it good? ..
Could it be improved?

Last edited by JadeEyes; 09-23-2012 at 04:13 PM..
JadeEyes is offline   Reply With Quote
Old 09-23-2012, 04:14 PM   PM User | #3
JadeEyes
New to the CF scene

 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JadeEyes is an unknown quantity at this point
For the other one i'm still clueless..!! Please help..!!
JadeEyes is offline   Reply With Quote
Reply

Bookmarks

Tags
c++, program design

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:25 PM.


Advertisement
Log in to turn off these ads.