Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem: The Time in Words problem solution. Problem Solution: Please look at the attached picture and output. For this problem, I need FLOWCHART & COMPLEXITY.
Problem: The Time in Words problem solution.
Problem Solution: Please look at the attached picture and output. For this problem, I need FLOWCHART & COMPLEXITY.
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started