TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tristian Jong
NA
12
2k
C# Minor Error With Code
Jul 13 2019 8:30 AM
I keep getting error saying : Method must have return type (program.cs 13-12)error CS1520.
Please help! Thank you so much.
using
System;
using
SplashKitSDK;
public
enum
MenuOption
{
TestName = 0,
GuessThatNumber = 1,
Quit = 2,
}
public
class
Program
{
static
TestName()
{
string
name;
Console.WriteLine(
"Please Enter Your Name"
+ name);
Console.WriteLine(
"Hello "
+ name);
}
private
static
MenuOption ReadUserOption()
{
int
option;
Console.WriteLine(
"1 Will run test name, 2 Will play guess that number, 3 Will quit "
);
do
{
Console.Write(
"Choose an option [1-3]: "
);
option = Convert.ToInt32(Console.ReadLine());
}
while
(option <0 || option >4);
return
(MenuOption)(option -1);
}
public
static
void
Main()
{
MenuOption userSelection;
do
{
userSelection = ReadUserOption();
Console.WriteLine(userSelection);
switch
(userSelection)
{
case
MenuOption.TestName:
TestName();
break
;
case
MenuOption.GuessThatNumber:
Console.WriteLine(
"GuessThatNumber..."
);
break
;
case
MenuOption.Quit:
Console.WriteLine(
"Quit..."
);
break
;
}
}
while
(userSelection != MenuOption.Quit);
}
}
Reply
Answers (
2
)
Image Encryption and Decryption Using 3DES Algorithm C#
Retail Microsoft Dynamics Axsapta 2012