Click here to Skip to main content
15,884,739 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi! I am really new to programming and I don't understand a lot. I got some school homework and I really need help with it! Would be lovely if one kind soul could help me.

Task 1:
Ask the user for input (int) and using an if ... else statement, you will print different messages
depending on user input.
Is input an even number (2,4,6,8 ...) should it write "It is an even number".
Is the input an odd talk (1,3,5,7 ...) should it write "It is an odd number".
(tips: use modulus)


Task 2:
Use a pre-loop to print 0-9
Also, create a While loop in the same project to print 0-9 once more after the pre-run is complete
Also, print which loop you are using.

Task 3:
Create a program that receives text input from the user.
The user writes should then be printed 5 times and after the text it should be what cycle the loop is
on.
For example. The user writes "Hello" and the program prints it out 5 times

Task 4:
Create an application where "Main" should look like this:

C#
public static void main ()
{

SayHello ();
SayGoodBye ();

}

SayHello and SayGoodBye are methods / features that you must define and which should be called from you Main.

As I said, would be lovely if I could get some help!

I am supposed to use Visual Studio with Console App (.NET Framework)

What I have tried:

Not much since I do not understand anything ):
Posted
Updated 22-Sep-17 1:57am

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

The task is set out for you in a set of easy stages, which - when combined with the lecture(s) you just had - should be pretty easy stuff. Start by creating a C# Console App, and edit the Main method. Look at the Console Class (System)[^] and you will find basic examples under the ReadLine Method[^] which will get you started.

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
Comments
[no name] 22-Sep-17 23:16pm    
5 *
Quote:
Not much since I do not understand anything
Then it's time to study.
Take, for instance, Task1. You should be able to
  1. get an integer from the user
  2. check if it is odd or even (there's the hint 'use modulus')
  3. report the result to the user


Just using Google you can get help on each of the above steps:
C# read an int from console[^]
check if number is odd c#[^]
write to console C#[^]
 
Share this answer
 
v2
Quote:
Not much since I do not understand anything

Those tasks are among the most basic programming tasks possible.
Start study seriously, check your lessons, find a tutorial or have a talk with your teacher.

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900