Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java on intellij please , thank you below the first photo is the previous answer i got using chegg and the error box showing it
java on intellij please , thank you
Given an array of ints, return true if the number of 3 's is greater than the number of 7 's. moreThreeSeven ([3,7,3]) true moreThreeSeven ([3,7,3,7]) false moreThreeSeven ([3,3]) true For example: Answer: (penalty regime: 0,10,20,50,% ) \begin{tabular}{l|l} 1 1 public boolean moreLowerUpper(int [] nums) \{ \\ 2 \\ 3 & // TODO your code goes here \end{tabular} Main. java: 29: error: method main(string[]) is already defined in class Main public static void main(string[] args) \{ Main. java: 26: error: cannot find symbol system.out.println(moreThreeseven(nums)); symbol: method moreThreeseven(int[]) location: class Main Main.java: 36: error: cannot find symbol System.out. println(moreThreeseven(nums)); ; symbol: method moreThreeseven(int [] ) location: class Main 3 errors Marks for this submission: 0.00/1.00. This submission attracted a penalty of 0.10. Program code based on above logic: //Main.java public class Matn //required function public static boolean morethreeseven(int nums [])\{ Ifinitialize counters int count 3=, count 7=j //loop through each value in the array for(int value: nums) // if current value is 3 , increment count 3 If (value =3 ) count 3++i //ff current yalue is 7 , increment courit? else if (value :7) count 7++3 ] I/return true if count 3> count7, else false neturn count 3> count7; public static void main(String [] args) \{ 1/ testing int[] nums =(7,7,3,3}; Systen, out, println(inoreThreeseven(nums)) below the first photo is the previous answer i got using chegg and the error box showing it didnt work
Step 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