Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

C# Help please

Ask the user to input either the lower or upper tier.


Ask the user their age in years.


If they are booking in the lower tier then seats for over 65’s will be £10 and below 16 are £5. All others are priced at £20.


For the upper tier, all tickets are increased by £5.

Best Answers

  • HNJHNJ Member
    Accepted Answer
    Console.writeLine("Which Tier");
    string tier = Console.readLine();
    Console.writeLine("Your Age");
    int age = Console.readLine();
    //Lower Part
    if (tier == "lower" && age> 65) {
            int price = £10;
    } elif (tier == "lower" && age < 16) {
            int price = £5;
    } elif (tier == "lower" && age > 16 && age < 65) {
            int price = £20;
    }
    
    //Upper Part
    if (tier == "upper" && age> 65) {
            int price = £15;
    } elif (tier == "upper" && age < 16) {
            int price = £10;
    } elif (tier == "upper" && age > 16 && age < 65) {
            int price = £25;
    }
    


    hope this helps

    And any correction is invited by anyone

  • iVxlticiVxltic Member
    Accepted Answer

    fixed on of the issues but i still have another one


Answers

Sign In or Register to comment.