Help! Homework! Deadline closing in C#. RRS feed

  • Question

  • Hi.

    I know this is embarrassing but need assistance in school tasks and the deadline is in 3 hours. Just started so.
    Help me out? THANKS. I know I'm supposed to learn from these but due a bureatrical error I'm in a course out of my skill level. Am prob not going to continue ICT cause this is just too much, but you really could save me from an embarrassment.

    #1 Make a program which asks the age of the user and their mother and prints out the result of the subtract of the two ( mother's age - your age )

    #2 Make a program which asks the sides of a square. After this the program counts the surface area of the square.

    #3 Make a program which asks the beam of a circle and then counts the surface area of the circle.

    #4 Make a program which asks too much calories. Program prints out how many joules did you consume. "2000 too much calories, 8363 in Joules"

    #5 Make program bouncer which asks are you above 18 if yes then it says "welcome" if no then "go back home, and grow up".  Make it also so that if your age is between 18 and 20 the program asks for IDs, if no then it says "Nice Try"

    #6 Make a program that tells is the number the user gives uneven or even

    #7 Make a program that asks did you score below 45 or if you made it above 55 you can pat yourself on the back

    #8 Make a program that asks for your grade 0 - 5 and uses switch-case 

    0 - fail
    1 - satisfying
    2 - satisfying
    3 - good
    4 - good
    5 - excellent

    #9 Make a program that prints out numbers that can be divided with number 3 between 1 - 1000. Use while loop.

    #10 Make a program that makes the user guess a number between 1 - 100 and if it's too big the program prints out "too big" if it's too small then "too small" and when it's right it prints out " you got it!". Use while-loop.

    #11 Make a program that asks for 10 numbers from the user and then tells the sum of those number and the average.

    #12 Same #11 but ask how many numbers do you want to input

    #13 Make a program that asks 10 numbers and spills them out in the reserve order. Use for-loop and table.

    #14 Make a program that asks how many stars should we print and then prints them like this


    #15 Make a program that asks variable of a hastag square and then prints them for example 4 x 2.


    Love you!
    Thanks in advance!

    Monday, October 29, 2018 5:23 PM

All replies

  • Hi,

    you will need some var str = Console.ReadLine();, Int32.Parse(str); or better Int32.TryParse(str, out int i); and some calculations like result = i1+i2; usw... Output it with Console.WriteLine($"Text {i1} {i2}");

    I hope this gives you some ideas how to start, and now hurry up! ;P

    namespace ConsoleApp
        public class Program
            public static void Main(string[] args)
                Console.WriteLine("Input your mothers age:");
                var str1 = Console.ReadLine(); //Putin some values
                Console.WriteLine("Input your age:");
                var str2 = Console.ReadLine(); //Putin some values
                if (Int32.TryParse(str1, out int motherAge)
                    && Int32.TryParse(str2, out int yourAge))
                    //If you get here, the input is a valid int32
                    //Do your calculation
                    var result = motherAge - yourAge;
                    Console.WriteLine($"Your mother was {result} years old, when she got You!");
                    Console.WriteLine("Invalid input!");
                // ...

    This is just #1

    Greetings, Chris

    Monday, October 29, 2018 5:54 PM
  • Right thanks! AAAAAAA


    Monday, October 29, 2018 6:45 PM
  • Hi,

    one more hint: I think you need a dictionary for #8

    var dictionary = new Dictionary<int, string>
       {0, "fail"},
       {1, "satisfying"},

    Monday, October 29, 2018 7:09 PM
  • One more hint for #4:

    var joules = calories * 4184;


                if(age >= 18)
                    if(age > 20)
                        if(Console.ReadLine() == "Yes")

    #6 & #9 use modulo:

    var result = x % 2;


    while (...)

    Monday, October 29, 2018 7:41 PM
  • #10

    var list = new List<int>();
    int sum = 0;
    for(int i=0;i<10;i++)
        int input;
        while (!Int32.TryParse(Console.ReadLine(), out input)) Console.WriteLine("Invalid, try again");
        sum += input;
    int average = 0; // calc average

    The for loop can be used by some other lessons, too.

    I hope thats enough to finish your home work. From now on you should do it earlier... ;)

    Greetings, Chris

    Monday, October 29, 2018 7:54 PM

  • I know this is embarrassing but need assistance in school tasks and the deadline is in 3 hours. Just started so.

    You waited until 3 hours before they're due to write 15 programs?
    That's approximately 12 minutes per program. Is that overconfidence
    or a failure to appreciate what's involved in coding a program?

    I'd never kick someone who is down, or preach to a busy man, but I'm
    afraid you may have relied too much om the sympathy of others to complete
    these programs. Most of the participants in these forums studiously if not 
    scrupulously avoid doing course assignments for students.

    If faced with a set of tasks like this in the future, I suggest you read
    over the specs and start by focusing on the ones that you're confident
    you can complete. Do first the ones that are easiest for you. Narrow
    your focus to one program at a time, and don't flood your mind with the
    details and requirements of many different and unrelated tasks. The
    programs don't have to be written in the order given.

    It's unfortunate if you were allowed to enroll in a course of studies
    without having the necessary prerequisites. But that is a failure of 
    the institution, not of you. So persevere, refocus, and remain confident
    but realistic about your abilities. But don't leave everything to the
    last minute - or hour. That's just courting failure.

    - Wayne

    • Edited by WayneAKing Monday, October 29, 2018 8:08 PM
    Monday, October 29, 2018 8:07 PM
  • There are 3 tasks in the list and the first one was in 3 hours.

    But thanks for the comment! That is true, but this was due to the fact that I didn't have a proper programming environment last week. So I am a bit due. But in an odd way I kinda like it. Makes life exciting I suppose. But right! Thanks you for the cheer up! And for the answer so far! I easily burn out and blame self for everything happening around me. So part reason I am reconsidering ICT as my career option. I could always go to the media side more as I'm artistically very capable; unfortunately people who seem to be very deep always seem to be very fragile and anxious as well.

    Monday, October 29, 2018 8:25 PM
  • Hi Kuuppax,

    Since it is homework, I would suggest that you could write the code by yourself, if you encounter any issue on your application, welcome to post your issue on this forum, it will be beneficial to understand c# programming. 

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Tuesday, October 30, 2018 2:51 AM