![ashleyrover11](/avatars/9085.jpg)
ashleyrover11
19.07.2019 •
English
Write a method string gettimename (int hours, int minutes) that returns the english name for a point in time, such as "ten minutes past two", "half past three", "a quarter to four", or "five o'clock". assume that hours is between 1 and 12.
Solved
Show answers
More tips
- S Sport How to Pump Your Chest Muscle? Secrets of Training...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
- S Style and Beauty How to Make Your Lips Fuller? Ideas and Tips for Beautiful Lips...
- S Style and Beauty How are artificial nails removed?...
- F Family and Home How to Sew Curtain Tapes: Best Tips from Professionals...
- H Horoscopes, Magic, Divination How to Cast a Love Spell on a Guy? Guide for Guys...
- F Family and Home How to Properly Use a Water Level?...
- L Legal consultation What Documents Are Required for a Russian Passport?...
- H Health and Medicine How to Treat Styes: Causes, Symptoms, and Home Remedies...
- F Family and Home Protect Your Home or Apartment from Pesky Ants...
Answers on questions: English
- E English A young boy jumps out of his bedroom window to see if he can fly after watching the film Peter Pan. Which category of cumulative media effects does this represent?...
- E English Which word from the excerpt does morris use to refer to things...
- E English Which principle was bult into the Constitution? Ounlimited presidential power O shared power between states and local governments Oshared power between people and the...
- E English (ASL) Because of the rising civil rights movement in the 1950s and 1960s, the Vietnam War (1955-1975) was the first war in which Deaf people were NOT allowed to serve...
- E English Read the sentence the breeze was a gentle caress a metaphor b simile c personification d onomatopeia...
- E English Why does olaudah equiano include vivid sensory details in his writing...
- E English Someone plz write me a script for my cla im dying...
- E English Me..adam is 1m and 55cm tall. he is with 28 cm taller than martin. and gus is with 51 cm taller than martin. who is the tallest, the middle one, and the smallest one?...
- E English According to martin luther king, jr., which of the following is not an example of an unjust law? a.a code that is out of harmony with the moral law b.a code that a...
- E English How does beowulf’s physical stature compare to that of his men...
Ответ:
Hope I understood your question...
Ten minutes past two = two ten
half past three = three thirty
a quarter to four = four forty-five
Five o'clock = five
then you can add a.m or p.m.
Hope I helped !!
Ответ:
// Program is written in Java Programming Language
// Comments are used for explanatory purpose
// Program starts here
public static String getTimeName(int hours, int minutes) {
// Check for valid time
if ((hours >= 1 && hours <= 12) && (minutes >= 0 && minutes <= 59)) {
// Create an array to hold valid minutes in English
String validminutes[] = {
"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty", "Twenty one", "Twenty two", "Twenty three", "Twenty four", "Twenty five", "Twenty six", "Twenty seven", "Twenty eight", "Twenty nine" };
String validtime;
// Start Conversion
if (hours == 12){ // Set time to be One
validtime = validminutes[1];}
else{ // Set time to be ahead by one hour
validtime = validminutes[hours + 1]; }
// Check for minutes
if (minutes == 0){ // Replace 0 with O' Clock
System.out.println(validminutes[hours] + "O' Clock");}
else if (minutes == 15){// Replace with quarter past
System.out.println("Quarter past " + validminutes[hours]);}
else if (minutes == 30){// Replace with half past
System.out.println("Half past" + validminutes[hours]);}
else if (minutes == 45){// Replace with quarter to
System.out.println("Quarter to" + a);}
else if (minutes < 30){ // for other minutes between 1-29
System.out.println(validminutes[minutes] + " " + "past" + validminutes[hours]);}
else{ // Other minutes
System.out.println(hour_mint[60 - minutes] + " " + "to " +validtime);}
}
// End of Valid Time
else { // Invalid Tine
System.out.println("Time not valid ");
}
}
// End of Program
Ответ:
first me
second the guy in my pfp
Explanation:
(⌐■-■)(⌐■-■)
hope helps