Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Time in Words problem solution. I solved this problem, but please write down the algorithm. Please look at the attached picture and output. For

The Time in Words problem solution. I solved this problem, but please write down the algorithm.

Please look at the attached picture and output. For this problem, I need ALGORITHM. I don't need code. I just need the algorithm of this problem.

image text in transcribedimage text in transcribed

image text in transcribedimage text in transcribed

import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { = ! I = Scanner sc = new Scanner(System.in); Integer hour = Integer.parseInt(sc.nextLine()); Integer min = Integer.parseInt(sc.nextLine()); String[] numNames = { "", "one", " two", " three", " four", " five", six", " seven", "eight", " nine", "ten", "eleven", twelve", " thirteen", " fourteen", "fifteen", "sixteen", seventeen", " eighteen", " nineteen" }; String[] tensNames = { "", "ten", " twenty", "thirty", " fourty", 'fifty", "sixty", "seventy", "eighty", " ninety" }; String sepStringi =" minutes past"; String sepString2 =" minutes to "; String minString = if (min o) System.out.println(numNames[hour].trim() + " o'clock"); else if (min == 15) System.out.println("quarter past " + numNames[hour].trim()); else if (min 30) { min = 60 - min; if (min == 1) sepString2 =" minute to "; if (min

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

How will these issues affect the grade levels you will teach?

Answered: 1 week ago