Question
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:
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 completeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started