Please help! it is on edhesive.
4.1 Code Practice
Question 1:
Write a program that asks the user to enter a name, and then print "Nice to meet you NAME". Your program should repeat these steps until the user inputs "Nope".
Answers
#this is a comment
#this program is in python
name=input("enter your name:")
for i in name:
if(i=="nope"):
break
else:
print("nice to meet you",name)
Program to print "Nice to meet you NAME"
Explanation:
//Program logic is written in C# programming language
//You can use here Reading input and printing output as per your //programming language
//In the below program we will not give any condition under for loop
for(int x = 0; ; x++)
//There will be no condition
{
Console.WriteLine("Enter your name:");
string strName = Console.ReadLine();
if (strName == "Nope" || strName == "nope" )
{
break;
//Automatically out of the loop
}
Console.WriteLine("Nice to meet you " + strName);
}