Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I have my program in JGrasp Java format that is close to running but I got an error message saying: Can anyone help me

So I have my program in JGrasp Java format that is close to running but I got an error message saying:

image text in transcribed

Can anyone help me fix my 3 errors so the program can run fully? Thank you in advance.

My current code is posted below:

import java.io.*; import java.util.*; class main{ public static void compute_result(int[] acc_drunk,int[] acc_non_drunk){ float best_percentage = 100.0; int best_hour = -1.0; float worst_percentage = 0.0; int worst_hour = -1.0; for (int i = 0; i worst_percentage){ worst_percentage = per; worst_hour = i; } if (per

e.printStackTrace(); } } }

-jGRASP exec: javac -g main.java main.java:11: error: incompatible types: possible lossy conversion from double to float float best ercentage = 100.0; main.java:13: error: incompatible types: possible lossy conversion from double to float float worst-percentage = 0.0; main.java:17: error: incompatible types: possible lossy conversion from double to float + float (acc drunk[i]/(0. O drunk[] + drunk[i])) 100; * per = acc-non acc 3 errors jGRASP wedge: exit code for process is 1. jGRASP: operation complete

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions