Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I cannot properly format my last function, lines 39 to 48. i also want to call the function in the main so that if i

I cannot properly format my last function, lines 39 to 48. i also want to call the function in the main so that if i input a negative number it tells the user to enter a positive number.
image text in transcribed
image text in transcribed
cumenteleanProjects Students maina GRASP OSD (wa) Cool Window Help 1 import java.util.Scanner; 2 4 public class Averageflumber 5 6 public static void main(String[] args) Scanner Input - new Scanner(System.in); 9 System.out.println("What is the first number: "); 10 int number - Input.nextInt(); 11 System.out.print In("What is the second number: "); 12 int number = Input.nextInt(); 1 System.out.println("What is the third number: "); 16 int number input.nextInt(); 15 input.close(); 16 System.out.println("The addition of the three numbers is: addition (number, numbers, number()); 17 System.out.println("The average of these three numbers average number numbers, ruberc)) 110 Goodbye(): 19 20 21 public static int average int X. inty, int 230 22 21 return (XYZ) / 3 24 1 35 26 public static int addition(int D. Int , int ) 27 20 return (DEF), 19 > 13 oblic static void Goodbye 12 System.out.println("Thack You for calculating the Avec) System.out.printinue attice Day": VA 1 intercheck 3 10 0 if (number ) archi G ocumenteleans Projects Students maina GRASP CSD Cava Tools Window Help input.close(): System.out.println("The addition of the three numbers is + addition(number, numberll, nuberc)) System.out.println("The average of these three numbers is + average number, number, number()) Goodbye(): public static int averape(int X. int Y. Int 2) 15 16 12 18 19 20 21 22 23 24 25 25 27 28 29 return (X+Y+2)/3 2 public static int addition(int n, int E. Int F) return (D-E.F) 21 12 33 314 15 public static void Goodbye System.out.println("Thank you for Calculating the Aver) System.out.printinave. Nice Day 12 3 30 40 1 public int HubercheckOX it (number the legal exception number entered isti, number the positive ) else (number0) return ruber: 44 4 arch O G

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

Step: 3

blur-text-image

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

LO4 Identify a system for controlling absenteeism.

Answered: 1 week ago