Question 2 (a) Write a program to repeatedly read in integers (negative and positive) from the user and zero (0) to terminate the reading. From the inputs, calculate how many are positive and how many are negative. (b) Create the following class method with Java: (i) Create a method called checkLast Digit that receives a String parameter. The method will display the last digit of the parameter. (ii) Write a method called sumScores that receives a double array as scores. This method will return the average of the scores.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter7: Using Methods
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question

java code, need question b (i) &(ii) only, No need question a

Question 2
(a) Write a program to repeatedly read in integers (negative and positive) from the user and
zero (0) to terminate the reading. From the inputs, calculate how many are positive and
how many are negative.
(b) Create the following class method with Java:
(i) Create a method called checkLast Digit that receives a String parameter. The
method will display the last digit of the parameter.
(ii) Write a method called sumScores that receives a double array as scores. This
method will return the average of the scores.
Transcribed Image Text:Question 2 (a) Write a program to repeatedly read in integers (negative and positive) from the user and zero (0) to terminate the reading. From the inputs, calculate how many are positive and how many are negative. (b) Create the following class method with Java: (i) Create a method called checkLast Digit that receives a String parameter. The method will display the last digit of the parameter. (ii) Write a method called sumScores that receives a double array as scores. This method will return the average of the scores.
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage