Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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..!!

  • #2
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For the other one i'm still clueless..!! Please help..!!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •