In: Computer Science
I am needing assistance figuring out how to write the code for this project in C# (C sharp)...
Create a new Project and name it - InClassParticipation3
Get up to 5 inputs from the user. The user must enter at least 1
number.
After the first input, ask them if they would like to input another
number if they say 'yes' get the provided input and multiply it to
the other inputs provided by the user.
If the user says 'no', do not prompt them to input any more numbers
and then figure out if the number is divisible by 3, 5, both 3 AND
5, or none of the provided options.
If the number is divisible by 3, output the number and then
'YAY'.
If the number is divisible by 5, output the number and then
'ME'.
If the number is divisible by both 3 and 5, output the number and
then 'YAYME!!'.
If it is not divisible by either 3 or 5, simply just output the
number.
using System; public class InClassParticipation3 { public static void Main(string[] args) { int num, total = 1; string choice; do { Console.Write("Enter a number: "); num = Convert.ToInt32(Console.ReadLine()); total *= num; if (num % 3 == 0 && num % 5 == 0) { Console.WriteLine("YAYME!!"); } else if (num % 3 == 0) { Console.WriteLine("YAY"); } else if (num % 3 == 0) { Console.WriteLine("ME"); } else { Console.WriteLine(num); } Console.Write("Do you want to enter another number(yes or no): "); choice = Console.ReadLine(); } while (choice == "yes"); Console.WriteLine("Product of all numbers entered is: " + total); } }