Question

Need to write an IPO for this code sample code below what i have done in...

Need to write an IPO for this code sample code below what i have done in IPO below that

    //collects data and checks that its between the 24 hour and 59 min
            // changes
            Console.WriteLine("Enter starting hour : ");
            int hour = int.Parse(Console.ReadLine());
            while (hour < 0 || hour > 23)
            {
                Console.WriteLine("\nEnter starting hour : ");
                hour = int.Parse(Console.ReadLine());
            }
            Console.WriteLine("\nEnter starting minute : ");
            int minute = int.Parse(Console.ReadLine());
            while (minute < 0 || minute > 59)
            {
                Console.WriteLine("\nEnter starting minute : ");
                minute = int.Parse(Console.ReadLine());
            }
            Console.WriteLine("\nEnter elapsed hour : ");
            int ehour = int.Parse(Console.ReadLine());
            while (ehour < 0)
            {
                Console.WriteLine("\nEnter elapsed hour : ");
                ehour = int.Parse(Console.ReadLine());
            }
            Console.WriteLine("\nEnter elapsed minute : ");
            int eminute = int.Parse(Console.ReadLine());
            while (eminute < 0 || eminute > 59)
            {
                Console.WriteLine("\nEnter elapsed minute : ");
                eminute = int.Parse(Console.ReadLine());
            }
            Console.WriteLine("\nPlease wait while we calculate.....");
            System.Threading.Thread.Sleep(3000);
            Console.Clear();

            Console.WriteLine("\nStarting hour : " + hour);
            Console.WriteLine("\nStarting minute : " + minute);
            Console.WriteLine("\nElapsed hour : " + ehour);
            Console.WriteLine("\nElapsed minute : " + eminute);
            ehour = ehour % 24;
            hour = hour + ehour;
            minute = minute + eminute;
            int i = minute / 60;
            hour += i;
            minute = minute % 60;
            hour = hour % 24;
            Console.WriteLine("\nFinish time in hours and minutes is : " + hour + ":" + minute);
            Console.WriteLine("\nPress any key to end program");
            Console.ReadKey();
        }
    }
}

Input

Processing

Output

Minutes

Hour

eminutes

ehour

Processing items:

Algorithm:

Check If input data for hour is between 0 and 23

Check if input data for hour is between 0 and 59

ehour

0 0
Add a comment Improve this question Transcribed image text
Answer #1

input-processing-output chart(problem:Finish time in hours and minutes input processing output prompt to collect hour,minute,

Add a comment
Know the answer?
Add Answer to:
Need to write an IPO for this code sample code below what i have done in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • [C#] I need to convert this if/else statements into Switch I have the code for the...

    [C#] I need to convert this if/else statements into Switch I have the code for the if/else but now need to turn it into a switch. The Console.WriteLine and all that is fine. I just need to convert the if/else.      int x1, x2, y1, y2;                 Console.WriteLine("What is smallest value of x:");                 x1 = Convert.ToInt32(Console.ReadLine());                 Console.WriteLine("What is largest value of x:");                 x2 = Convert.ToInt32(Console.ReadLine());                 Console.WriteLine("What is smallest value of y:");                 y1 = Convert.ToInt32(Console.ReadLine());                 Console.WriteLine("What is largest value of y:");                 y2 =...

  • Hello in C#. I need help understanding and knwoing what i missed in my program. The...

    Hello in C#. I need help understanding and knwoing what i missed in my program. The issue is, the program is supposed to have user input for 12 family members and at the end of the 12 it asks for user to input a name to search for. When i put a correct name, it always gives me a relative not found message. WHat did i miss. And can you adjust the new code so im able to see where...

  • i need help fixing my code. here is the assignment: Make a class that contains the...

    i need help fixing my code. here is the assignment: Make a class that contains the following functions: isLong, isDouble, stringToLong, and stringToDouble. Each receives a string and returns the appropriate type (bool, bool, long, and double).During the rest of the semester you will paste this class into your programs and will no longer use any of the "standard" c# functions to convert strings to numbers. here is my code. it works for the long method but not the double:...

  • Need help with this java code supposed to be a military time clock, but I need...

    Need help with this java code supposed to be a military time clock, but I need help creating the driver to test and run the clock. I also need help making the clock dynamic. public class Clock { private int hr; //store hours private int min; //store minutes private int sec; //store seconds public Clock () { setTime (0, 0, 0); } public Clock (int hours, intminutes, int seconds) { setTime (hours, minutes, seconds); } public void setTime (int hours,int...

  • I need help with the following assignment: Write an application named DailyTemps that continuously prompts a...

    I need help with the following assignment: Write an application named DailyTemps that continuously prompts a user for a series of daily high temperatures until the user enters a sentinel value of 999. Valid temperatures range from -20 through 130 Fahrenheit. When the user enters a valid temperature, add it to a total; when the user enters an invalid temperature, display the error message: Valid temperatures range from -20 to 130. Please reenter temperature. Before the program ends, display the...

  • (C#, Visual Studio) I need help modifying my program code to accommodate repeated numbers. For example,...

    (C#, Visual Studio) I need help modifying my program code to accommodate repeated numbers. For example, if a user inputs a repeated number the program should regenerate or ask to enter again. If needed, here is the program requirements: Create a lottery game application. Generate four random numbers, each between 1 and 10. Allow the user to guess four numbers. Compare each of the user’s guesses to the four random numbers and display a message that includes the user’s guess,...

  • Fix the code using C# shown below to show the repitition as seen on the example...

    Fix the code using C# shown below to show the repitition as seen on the example screenshot: (Invalid error must repeat): using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Program { class Program { static void Main(string[] args) { double num, count = 0; double Tax = 0.00, ship = 5.00, sum = 0.00; double grandtotal; char line; //Set run =true bool run=true; do { //read amount of item Console.WriteLine("What is the amount of item : "); //read in...

  • Need some assistance of reorganizing this whole program. I have the right code for everything I...

    Need some assistance of reorganizing this whole program. I have the right code for everything I just need help on putting all the codes in the right spot so it can come out to the correct output. output is supposed to look like this: 1 \\ user inputs choice to convert 12 to 24 8 \\ user inputs 8 for hours 30 \\ user inputs 30 for minutes 20 \\ user inputs 20 for seconds AM \\ user inputs AM...

  • So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I...

    So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I need help editing my code. I want my quiz to clear the screen after each question. It should do one question at a time and then give a retry of each question that was wrong. The right answer should appear if the retry is wrong. After the 1 retry of each question, a grade should appear. Please note and explain the changes you make...

  • POD 3: Tick Tock Instructions There are 24 hours in a day, but we all think...

    POD 3: Tick Tock Instructions There are 24 hours in a day, but we all think about them differently. Some people and places in the world work with a 24-hour clock that goes from 0:00 to 23:59, while others work with a 12-hour clock that goes from 12.00AM to 11:59PM 24-hour clock 0.00 (midnight) 1200 (noon) 23:59 (one minute before midnight), A COLLAPSE 12-hour clock: *12.00 AM" (midnight) *12:00 PM" (noon) "11:59 PM" (one minute before midnight), You are going...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT