answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
8090
9 days ago
6

Write a method string gettimename (int hours, int minutes) that returns the english name for a point in time, such as "ten minut

es past two", "half past three", "a quarter to four", or "five o'clock". assume that hours is between 1 and 12.
English
2 answers:
hammer [6.4K]9 days ago
6 0

Response:

// This program utilizes the Java Programming Language

// Comments included for clarification

// Program begins here

public static String getTimeName(int hours, int minutes) {

// Verify the time is valid

if ((hours >= 1 && hours <= 12) && (minutes >= 0 && minutes <= 59)) {

// Prepare an array for valid minute representations

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;

// Begin Conversion Process

if (hours == 12){ // Convert time to One

validtime = validminutes[1];}

else{ // Adjust time to one hour forward

validtime = validminutes[hours + 1]; }

// Determine minutes

if (minutes == 0){ // Output O' Clock for 0

System.out.println(validminutes[hours] + "O' Clock");}

else if (minutes == 15){// Output quarter past

System.out.println("Quarter past " + validminutes[hours]);}

else if (minutes == 30){// Output half past

System.out.println("Half past" + validminutes[hours]);}

else if (minutes == 45){// Output quarter to

System.out.println("Quarter to" + a);}

else if (minutes < 30){ // Handle minutes ranging from 1-29

System.out.println(validminutes[minutes] + " " + "past" + validminutes[hours]);}

else{ // Manage other minute cases

System.out.println(hour_mint[60 - minutes] + " " + "to " +validtime);}

}

// Closure of Valid Time Check

else { // Time deemed invalid

System.out.println("Time not valid ");

}

}

// End of the Program

seraphim [6.2K]9 days ago
4 0
Hello!!

I believe I grasped your inquiry...

Ten minutes after two equals 2:10
half past three translates to 3:30
a quarter to four means 3:45
Five o'clock = 5

then you can specify a.m. or p.m.

I hope this assists you!!

You might be interested in
Tom’s death most closely connects to which theme(s)? Select all that apply.
Gnom [6414]

Answer:

This inquiry connects to the narrative of Uncle Tom’s Cabin.

Explanation:

The narrative focuses on a merciless killer who brutalized and punished his slaves. However, at one point in his life, he found himself at the mercy of those same slaves, who chose to show him kindness and spared his life. This transformation was significant.

The lesson illustrates that Christianity offers a means to eradicate poverty and slavery. Tom's demise also reflects the true strength of Christianity.

6 0
29 days ago
Read 2 more answers
I want your laughter like the flower I was waiting for, the blue flower, the rose of my echoing country. YOUR LAUGHTER from The
hammer [6495]

The choices that answer your inquiry are A and C, also referred to as:

This illustrates a sense of pride and yearning for the homeland.

The laughter serves as a figurative representation of nationalism.

7 0
18 days ago
Select the correct answer from each drop-down menu. (please select one of the options in parentheses, each possible answer has "
seraphim [6266]

The appropriate selections for each drop-down menu are these:

In the article "The Melting Arctic," persuasive methods are employed to influence public opinion. One technique used is scientific data, which depends on evidence presented through graphs, charts, and facts. Additionally, the article uses expert opinion, which means a recognized professional endorses a particular idea or viewpoint.

On the other hand, the NOAA video appeals to the audience's emotions by showing animals. It conveys passionate assertions about the deteriorating conditions in the Arctic and how these negatively impact wildlife.

The phrase "in contrast" signals that what follows opposes what has been mentioned before. Since the first paragraph emphasizes scientific evidence, the second should appeal to the opposite—feelings and beliefs. Among the adjectives provided, "passionate" is the only one positively matching "emotions."

4 0
1 month ago
Read 2 more answers
In his short autobiographical essay, Sorrentino says, "Much like other writers, I have won some literary awards." This statement
hammer [6495]
The statement is an understatement since he claims he "does not write all that much." This kind of understatement in his brief autobiographical essay reflects a tone similar to that found in "There's a Man in the Habit of Hitting Me on the Head with an Umbrella."

An understatement serves as a literary device where authors portray an occurrence as less significant than it truly is.

5 0
6 days ago
Read 2 more answers
Read these lines from "The Lonesome Death of Hattie Carroll" and answer the question.
Naddik [6381]
Formal and informal speech, along with the relationship between music and lyrics
3 0
1 month ago
Read 2 more answers
Other questions:
  • Select the correct answer from each drop-down menu. Based on what you learned about hyphens, complete the sentences. The profess
    15·1 answer
  • In at least one hundred words, compare and contrast David Lance Goines’s perspective of the Vietnam War as it is presented in “L
    7·2 answers
  • I’d also like to demystify the idea that fairy tales are of use only to writers of fantasy or fabulism. I’d like to celebrate th
    11·2 answers
  • In this excerpt from President John F. Kennedy’s inaugural address, the word “forebears” most likely means _____.
    8·1 answer
  • in 75-100 words, describe the mood evoked by the ending of "marigolds." how does the author evoke that mood?
    12·1 answer
  • Read the sentence from “Hmong Tops.”
    13·2 answers
  • Discuss how these excerpts from the play help to illustrate the theme of morality versus law in Antigone.
    9·2 answers
  • Why is language an important tool in developing a monster character in a story?
    11·2 answers
  • Match each description to the correct form of ode,
    10·1 answer
  • Which statements describe haiku? Check all that apply.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!