Question

In: Computer Science

I am needing assistance figuring out how to write the code for this project in C#...

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.

Solutions

Expert Solution

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);
    }
}


Related Solutions

Hello I am needing an example of how to write an assembly (MIPS) code that with...
Hello I am needing an example of how to write an assembly (MIPS) code that with will ask the user for two numbers then for addition or multiplication by typing in + or * into the command prompt. For example if I type in the number 2 and 5 then + The code should add the sum between the two numbers like 2 + 3 + 4 + 5 = 14. If multiplication is implemented then it will do the...
The Question I am needing assistance with is in BOLD BELOW. I will include the other...
The Question I am needing assistance with is in BOLD BELOW. I will include the other aspects of this assignment for reference, as well as the table used/needed for these calculations. Option #1: Critical Thinking: Quality at A1 Hotels A1 Hotels operates luxury hotels throughout the world. Recently, motivated by some incidents that appeared in the news, they have been concerned about the quality of service. The company has been giving the following survey to its clients after their stay:...
I am having difficulties with figuring out the formulas for this this question. Is there a...
I am having difficulties with figuring out the formulas for this this question. Is there a walk-through for this? You are the manager of a monopoly that sells a product to two groups of consumers in different parts of the country. Group 1’s elasticity of demand is -2, while group 2’s is -3. Your marginal cost of producing the product is $30. a. You are a monopolist. b. You compete against one other firm in a Cournot oligopoly. c. You...
These are the correct answers but I am having difficulty figuring out how these figures were...
These are the correct answers but I am having difficulty figuring out how these figures were reached. On March ​1, 2018​, Nailtique Nail Salons issued $450,000 of 15​-year, 5 percent bonds payable. The bonds were sold for $432,000. The bonds pay interest each August 31 and February 28​, and any discount or premium is amortized using​ straight-line amortization. Requirement 1. Fill in the blanks to complete each statement. a. Nailtique Nail Salons' bonds are priced at (express the price as...
I have figured out this assignment, but I am having a hard time figuring out the...
I have figured out this assignment, but I am having a hard time figuring out the extra credit, Thanks! Creating a Rectangle class We have created a representation of a rectangle in C++ and extended it to create multiple representation's of rectangles. Classes can simplify that process considerably. In this assignment, your task is to convert the representation of a rectangle we created earlier in the semester to a Rectangle class. The Rectangle class shall consist of the following: The...
I'm having trouble figuring out the constraints to this problem. I know that I am maximizing...
I'm having trouble figuring out the constraints to this problem. I know that I am maximizing 55x + 45y, however the variables are throwing me off. I only need help on question #1 as it would be a great help to understanding the rest of what the questions are asking. The problem is as follows: NorCal Outfitters manufactures a variety of specialty gear for outdoor enthusiasts. NorCal has decided to begin production on two new models of crampons: the Denali...
I am having difficulty figuring out the rest of this problem, primarily with regards to calculating...
I am having difficulty figuring out the rest of this problem, primarily with regards to calculating APIC and Retained earnings for Stock Dividends. Also, I need assistance with the fourth problem, how to calculate the total value of shareholders' equity. Could you please help show me how to solve? Accounting for Share Transactions The shareholders' equity section of the consolidated balance sheet of Wilson Industries appeared as follows at the beginning of the year: Shareholders' Equity Class A common stock,...
I am trying to write a code in C for a circuit board reads in a...
I am trying to write a code in C for a circuit board reads in a temperature from a sensor on the circuit board and reads it onto a 7-segment LED display. How exactly would you code a floating 2 or 3 digit reading onto the LED display? I am stuck on this part.
I am having trouble figuring out how to To-Do list using java. Can anyone guide me...
I am having trouble figuring out how to To-Do list using java. Can anyone guide me through the steps for achieving this?
22. I am figuring out some numbers for my retirement and housing costs so I ask...
22. I am figuring out some numbers for my retirement and housing costs so I ask myself the following questions: How much will I have to invest annually to get to a million in 30 years if I think I can earn 7% per year 10,500 21,000 33,333 You wanted to refinance your home as interest rates have dropped and you are thinking of getting a 15 yr mortgage to cut your total interest payments over the life of the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT