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
2 months 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 [7.6K]2 months 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 [7.4K]2 months 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
Pls write a story that ends with the statement I had never felt so embarrassed in my life not less than 450
Leya [7781]
Everyone of us possesses unique qualities that set us apart from others. It’s crucial to identify and cultivate these traits, and once recognized, it’s essential to be humble and avoid becoming overconfident. As we achieve excellence in a specific area, expectations rise for us to perform at that level. In this context, maintaining humility and a sincere mindset is vital. I too discovered a talent, which occurred during a badminton game where I realized that basic shots came to me effortlessly. I considered it a unique gift. This realization led me to pursue a badminton career, and after two years of hard work, I became the champion at the district level, entering the professional realm of the sport. Over time, I began to believe I was the best, which caused a decline in my practice intensity, and I started to disregard the advice of senior players and my coach. Soon after, I entered a state-level tournament, and my previous humility was replaced by overconfidence, neglecting that many capable players existed. To my dismay, I was eliminated in the first round by a player I had previously defeated at the district level, leading to great disappointment. I felt I had let down my family and coach, and I was ashamed to face them. When my coach found me, I anticipated anger for my poor performance; instead, he was calm and kind, providing me with a profound lesson on hard work and humility. He noted my change in attitude, which contributed to my defeat, and advised that one should always stay grounded regardless of success levels, stressing the importance of respect and humility towards everyone, including opponents. From that moment, I pledged to abide by my coach's guidance throughout my life. Although my defeat was an embarrassing experience, it was a pivotal learning moment, never too late to recover and chart a better course.
4 0
1 month ago
Which presentation skill helps you emphasize important ideas? A. eye contact B. enunciation C. purposeful gestures D. convention
Lady bird [7499]

Response:

D. language conventions

7 0
1 month ago
In at least 150 words, describe how the style and technique of "Grass" contribute to its overall meaning.
Lady bird [7499]

Answer:

The poet employs anaphora, free verse, and personification

Explanation:

Carl Salsburg's poem utilizes a free verse format, integrating anaphora for emphasis and personification throughout the work.

Free verse indicates that the poem lacks a structured rhyme scheme or consistent meter.

Furthermore, anaphoras serve to underscore key phrases, such as "Shovel them under and let me work, I am the grass; I cover all." Likewise, the poet references numerous battlefields across Europe with the same repetitive style: "Pile the bodies high at Austerlitz and Waterloo. And pile them high at Gettysburg, And pile them high at Ypres and Verdun." Without such repetitive elements, the poem's core message might be missed.

Lastly, the grass in the poem is personified, speaking and acting in a way that symbolizes deep emotional themes. It represents life after death, ongoing life transitions, and societal forgetfulness.

These stylistic elements are essential for conveying the poem's intended message and depth.

3 0
3 months ago
The title of the poem “Mirror,” suggests that it _____.
Naddik [7538]

Sylvia Plath's poem Mirror skillfully uses allegory, personification, and metaphor. Considering the title, "Mirror," it naturally evokes the concept of reflection. Since mirrors serve to reflect, the most fitting interpretation is that the poem potentially deals with themes of self-examination.

 
8 0
3 months ago
Read 2 more answers
Read the excerpts from “Take the Tortillas Out of Your Poetry” and “Speaking Arabic.”
Gnom [7528]
<span>The rhetorical device that Anaya incorporates, which is absent in the Nye excerpt, is D.logos. Logos functions as an appeal to rational thought and reasoning. The first passage establishes its tone by portraying occurrences as they are, with a prominent 'cause and effect' relationship: the details provided by the author are backed by logic. Conversely, the second excerpt exemplifies irony through allusion, allowing it to be characterized as a literary anecdote.</span>
5 0
1 month ago
Read 2 more answers
Other questions:
  • In which passage is it clearest that the author is using diction to achieve some kind of effect?
    12·2 answers
  • For each drawing, provide the noun with its corresponding definite and indefinite articles. Follow the model. Not sure what I am
    11·1 answer
  • How does Wilde poke fun at Victorian society in the passage? Check all that apply. Lady Bracknell says her maid is trustworthy b
    8·2 answers
  • Find the word consequences in paragraph 44. Use context clues in the surrounding sentences, as well as the sentence in which con
    7·1 answer
  • Read the passage from chapter 5 of Animal Farm. On the third Sunday after Snowball's expulsion, the animals were somewhat surpri
    12·2 answers
  • When Socrates says that his accusers use "ornamented words," he is _____.
    10·2 answers
  • English needs rules for its use because rules _____
    5·2 answers
  • In what ways have the two Koreas grown apart? Discuss two ways in which they have grown apart and support each of your points wi
    10·1 answer
  • Choose the italicized controlling idea in the topic sentence below. A. In most American homes, family time is replaced with TV t
    10·1 answer
  • Which sentence from Their Eyes Were Watching God contains an example of dialect?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!