Question
1.Write a Java program that reads N numbers and displays the sum and mean of all numbers greater than zero, the sum and mean of
1.Write a Java program that reads N numbers and displays the sum and mean of all numbers greater than zero, the sum and mean of all numbers less than zero (negative number or zero), and the sum and mean of all numbers whether positive, negative or zero. The user can enter the numbers in any order. Your program should NOT require the user to enter positive and negative numbers separately.
2.Write a program that displays a triangle composed of the characters O and X from a value (You name n) user input. For example, if the user enters 3, your program should display: OOX OOXO If the user enters 5, your program should display: O OX O XO O XO X O X O XO
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