
Using jGRASP please de-bug this
/**
This program demonstrates an array of String objects.
It should print out the days and the number of hours spent at work each day.
It should print out the day of the week with the most hours worked
It should print out the average number of hours worked each day
This is what should display when the program runs as it should
Sunday has 12 hours worked.
Monday has 9 hours worked.
Tuesday has 8 hours worked.
Wednesday has 13 hours worked.
Thursday has 6 hours worked.
Friday has 4 hours worked.
Saturday has 0 hours worked.
Highest Day is Wednesday with 13 hours worked
Average hours worked in the week is 7.43 hours
*/
{
public class WorkDays
{
public static void main(String[] args)
{
String[] days = { "Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday"};
int[] hours = { 12, 9, 8, 13, 6, 4};
int average = 0.0;
int highest = 0;
String highestDay = " ";
int sum = 0;
for (int index = 0; index < days.length; index++)
{
System.out.println(days[index] + " has " + days[index] " worked.");
}
highest = hours[0];
for (int index = 0; index < days.length; index++);
{
if (hours[index] >= highest)
{
highest = hours[index];
highestDay = hours[index];
}
sum = sum + hours[index];
}
average = 7 / sum;
System.out.println("Highest Day is " + highestDay + " with " + highest + " hours worked");
System.out.printf("Average hours worked in the week is %4.2f hours", average);
}
}
![/**
This program demonstrates an array of String objects.
It should print out the days and the number of hours spent at work each day.
It should print out the day of the week with the most hours worked
It should print out the average number of hours worked each day
This is what should display when the program runs as it should
Sunday has 12 hours worked.
Monday has 9 hours worked.
Tuesday has 8 hours worked.
Wednesday has 13 hours worked.
Thursday has 6 hours worked.
Friday has 4 hours worked.
Saturday has 0 hours worked.
Highest Day is Wednesday with 13 hours worked
Average hours worked in the week is 7.43 hours
*/
{
public class WorkDays
{
public static void main(String [] args)
String[] days = { "Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday"};
int [] hours =
{ 12, 9, 8, 13, 6, 4};
int average = 0.0;
int highest = 0;
String highestDay =
int sum = 0;
";
for (int index = 0; index < days.length; index++)
{
System.out.println(days[index] +
}
+ days [index]
worked.");
%3D
has
highest = hours [0];
for (int index = 0; index < days.length; index++);
{
if (hours[index] >= highest)
{
highest = hours[index];
highestDay = hours[index];
}
sum = sum + hours[index];
average = 7 / sum;
System.out.println("Highest Day is " + highestDay + " with" + highest + " hours worked");
System.out.printf("Average hours worked in the week is %4.2f hours", average);
}](https://content.bartleby.com/qna-images/question/87311036-785b-48b7-ad0a-ffb7f8402d00/d9ed1744-2c3a-4418-9185-3976a7ff15b3/x8286hd_thumbnail.png)

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

- Please help me to code this Python It is High/Low Card Game The pyex is example of outputarrow_forwardJavaarrow_forwardJAVA PPROGRAM ASAP Please create this program ASAP BECAUSE IT IS MY LAB ASSIGNMENT so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade. Chapter 9. PC #2. Word Counter (page 608) Write a method that accepts a String object as an argument and returns the number of words it contains. For instance, if the argument is “Four score and seven years ago” the method should return the number 6. Demonstrate the method in a program that asks the user to input a string and then passes it to the method. The number of words in the string should be displayed on the screen. Test Case 1 Please enter a string or type QUIT to exit:\nHello World!ENTERThere are 2 words in that string.\nPlease enter a string or type QUIT to exit:\nI have a dream.ENTERThere are 4 words in that string.\nPlease enter a string or type QUIT to exit:\nJava is great.ENTERThere are 3 words in that string.\nPlease enter a string or type QUIT to exit:\nquitENTERarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





