Professional Documents
Culture Documents
Programming
Programming
Instructions
Write a C# statement to accomplish each of the following:
- In my perspective, timeIn is used when a user inputs the time that he or she arrived at work,
timeOut is used to define an endless waiting period or the end of the user's work, and workedHrs
is the sum of the user inputs and the waiting period or end of the user's work.
2. Prompt the user to enter a string. End your prompting message with a colon (:) followed by a space
and leave the cursor positioned after the space.
class Act1
{
static void Main()
{
Console.ReadKey();
}
}
Republic of the Philippines
POLYTECHNIC UNIVERSITY OF THE PHILIPPINES
BIÑAN CAMPUS
class Act1
{
static void Main()
{
string value;
int number;
number = Convert.ToInt32(value);
}
else
Console.Write("User is Legal");
}
}
Republic of the Philippines
POLYTECHNIC UNIVERSITY OF THE PHILIPPINES
BIÑAN CAMPUS
5. Display the message "This is a C# program" with each word on a separate line.
class Act1
{
static void Main()
{
System.Console.WriteLine("This");
System.Console.WriteLine("is");
System.Console.WriteLine("a");
System.Console.WriteLine("C#");
System.Console.WriteLine("program");
}
}