Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I need to write a C#.Net code for following output

User has to enter a number between (1-7). if particular user enter a number outside from that range should display the following error message.

Your number should be between (1-7).Please try again (User has only 3 attempts to enter number correctly)

else if user enter a valid number it should display like this.
1: One
2: Two (This means the output is both numeric and word)
Posted

Nice to see, enquirer himself adding the tags: GimmeCode and homework... :) .. so no downvoting!

Ok, now first thing you need to do is make some effort in writing what you mentioned. Nobody will given you the full code here. Try first, post issues or if you get stuck - people will be more than happy to help you.
 
Share this answer
 
As is mentioned, you need to show that you've tried. Regardless of whether it's really homework or you've picked the challenge from some website (a link is normally a good thing to back that up) you have to show that you at least understand the basics enough to try and follow.

Professional or hobbyist, you have to try.
 
Share this answer
 
Noone is going to write code for you.
 
Share this answer
 
We don't do people's homework for them. Assuming you've actually been attending your classes, your instructor should have given you everything you need to complete the assignment.

Instead of looking for the easy grade, do the frakking work. When/if you ever get a real programming job, the strategy you seem to be favoring right now will get you ridiculed and fired.

Good luck with that.
 
Share this answer
 
v2
you may be a professional programmer. But the thing is i'm just starting C#.NET studying alone and this is not a homework this a tutorial where i'm found from I-net.

==========

From JSOP: And I have a bridge I want to sell you...


From SM: Hope you read what we replied. We will help you, but you need to put some effort, start on what you want to do. If you are a total beginner, then would suggest, start with something more simpler such that you can atleast start coding on the type of problem asked here!

 
Share this answer
 
v3
repeat the following until done
get input from user
if input is less than 1 or input greater than 7 then display error message
else if input is equal to 1 then display "1: One"
else if input is equal to 2 display "2: Two"
else if input is equal to 3 display "3: Three"
else if input is equal to 4 display "4: Four"
else if input is equal to 5 display "5: Five"
else if input is equal to 6 display "6: Six"
else if input is equal to 7 display "7: Seven"
end repeat

===========

From JSOP: Your code block was causing the screen to horizontallay scroll - even on my 1680-wide display. How about some frakking line breaks in there?
====
To JSOP from AHZ: aww, so sorry, ftfy
 
Share this answer
 
v3

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