exercise.

exercise.

write a program that reads 10 numbers fin the largest number and count the occurrence of the largest number from declared array assume you assigned 4,6,3,2,5,6,6,1 and 6.

View Answers

May 17, 2011 at 4:32 PM

import java.util.*;
class  FindLargest{
    public static void main(String[] args){
        int max = Integer.MIN_VALUE;
        System.out.println("Enter 10 numbers:");
        Scanner input=new Scanner(System.in);
        int array[]=new int[10];
        int count=0;
        for(int i=0;i<array.length;i++){
            array[i]=input.nextInt();
            if (array[i] > max) {
                max = array[i];
               }
         }
         for(int i=0;i<array.length;i++){
             if(array[i]==max){
                 count++;
             }
         }
        System.out.println("Largest Number is "+max+" which occurs "+count+" times");
    }
}









Related Tutorials/Questions & Answers:
exercise.
exercise.  write a program that reads 10 numbers fin the largest number and count the occurrence of the largest number from declared array assume you assigned 4,6,3,2,5,6,6,1 and 6
Exercise 17
Exercise 17  Character Counter Write a program which takes an input string and determines the number of vowels, consonants, digits, and special characters (i.e., all other nonalphanumeric characters) in the string
Advertisements
Exercise 19
Exercise 19  Duplicates 2 Write a Java program that takes as input a string, determines how many characters has duplicates, and prints out each of those values, along with the count for each. Ignore spaces in the counting
Exercise 18
Exercise 18  Duplicates1 Write a Java program that determines how many values in a 100-element array has duplicates, and prints out each of those values, along with the count for each. Use the code given below to fill up your
Exercise 16
Exercise 16  Number Format Large numbers are typically written with a comma in between every group of three digits (e.g., 12,345,678,765,432 or -32,768). Write a Java program that accepts as input an integer and outputs
Exercise 20
Exercise 20  Common Letters Write a program that takes two words as input and finds any common letters that they have. For example, the words â??computerâ?? and â??programâ?? have the letters â??oâ??, â??mâ??, â??pâ??, and â??râ
ModuleNotFoundError: No module named 'exercise'
ModuleNotFoundError: No module named 'exercise'  Hi, My Python... 'exercise' How to remove the ModuleNotFoundError: No module named 'exercise... to install padas library. You can install exercise python with following
Asking for exercise - Java Beginners
Asking for exercise  Can you send me a small exercise question -a prograsm for collections in java?  Hi Friend, Please visit the following link: http://www.roseindia.net/javacodeexamples/index.shtml Thanks
ModuleNotFoundError: No module named 'SRSnester_exercise'
ModuleNotFoundError: No module named 'SRSnester_exercise'  Hi, My... named 'SRSnester_exercise' How to remove the ModuleNotFoundError: No module named 'SRSnester_exercise' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'kolibri-exercise-perseus-plugin'
ModuleNotFoundError: No module named 'kolibri-exercise-perseus-plugin' ...: ModuleNotFoundError: No module named 'kolibri-exercise-perseus-plugin' How to remove the ModuleNotFoundError: No module named 'kolibri-exercise-perseus-plugin' error
ModuleNotFoundError: No module named 'Exercise-publishing-package'
ModuleNotFoundError: No module named 'Exercise-publishing-package'  ...: No module named 'Exercise-publishing-package' How to remove the ModuleNotFoundError: No module named 'Exercise-publishing-package' error? Thanks
ModuleNotFoundError: No module named 'games-mlnd-exercise'
ModuleNotFoundError: No module named 'games-mlnd-exercise'  Hi, My... named 'games-mlnd-exercise' How to remove the ModuleNotFoundError: No module named 'games-mlnd-exercise' error? Thanks   Hi
ModuleNotFoundError: No module named 'tensorflow-exercise-hx'
ModuleNotFoundError: No module named 'tensorflow-exercise-hx'  Hi...: No module named 'tensorflow-exercise-hx' How to remove the ModuleNotFoundError: No module named 'tensorflow-exercise-hx' error? Thanks   Hi
ModuleNotFoundError: No module named 'Exercise-upload-distributions'
ModuleNotFoundError: No module named 'Exercise-upload-distributions'  ...: No module named 'Exercise-upload-distributions' How to remove the ModuleNotFoundError: No module named 'Exercise-upload-distributions' error
java exercise - Java Beginners
java exercise - Java Beginners
An exercise using (SRS) as a blue print for Abstraction and Modeling in a one page answer. Was this example correct?
An exercise using (SRS) as a blue print for Abstraction and Modeling in a one page answer. Was this example correct?  The software tool to help automate the process of producing a blueprint for problems with a television
What is the best online course to learn R?
c++ new, delete, string class
contained in string1: Exercise 1 Good morning Create a new string named string2... the following heading and the data contained in string2: Exercise 2 Good morning...: Exercise 3 20 Create an empty string named string4. Copy string3 into string4
Disadvantages Of Obesity
quantity Lack of exercise - People are eating a lot, but not doing any or enough exercise. Every one should do exercise regularly. You should perform Yoga Exercise to control your weight. Hereditary
Led Track Lighting
; Industrial, Exercise Fitness Equipment & much more
Airbrush Tattoos
Airbrush Tattoos  **Deleted by admin **, we are a direct importer and vendor of small business equipment & home goods. Buy at wholesale prices : Aquarium Supplies, Bicycle Motor, Business & Industrial, Exercise Fitness
Java code for set...!!!
Java code for set...!!!  Create 2 classes in same package Product.java productId, name, price ProductImpl.java create a set in this and try to add objects of product. You should write this exercise such that it should
Arrays
Arrays   Hi I need help with the following exercises. Exercise 1: Write a Java application in which the user is prompted for the total number... of all the values as well. Exercise 2: Write a Java application in which you
Implementing ArrayList's functionalities into arrays - Java Beginners
Implementing ArrayList's functionalities into arrays  Hi guys, i'm trying to solve an exercise were is asked to write a program that manages the grades of a list of students (given by the exercise) for one single exam; The list
\wrapper
\wrapper  Hands on Exercise on Wrapper Class: Write a Java code that converts integer to Integer converts Integer to String converts String to integer converts int to String converts String to Integer converts Integer
\wrapper
\wrapper  Hands on Exercise on Wrapper Class: Write a Java code that converts integer to Integer converts Integer to String converts String to integer converts int to String converts String to Integer converts Integer
\wrapper
\wrapper  Hands on Exercise on Wrapper Class: Write a Java code that converts integer to Integer converts Integer to String converts String to integer converts int to String converts String to Integer converts Integer
wrapper class concept
of this exercise, initialize a couple of String objects that contain an integer
Java Objectives Question
Java Objectives Question  Exercise 1: Create a file by using any word... as FileStatistics.java. Exercise 2: Create a file that contains your favorite movie quote. Use... Exercise 3: Write an application using the FileInputStream that opens a file
Which java can i download?
Which java can i download?  Hello, i'm a beginner on java. Which java can i download for to exercise with my codes? Thanks in advance.   nobody.   And i download Eclipse java. But when i want to install
XML in java - XML
argument.Then modify the program resulting from the this exercise so that it will accept
USE ARRAY TO FIND THE LARGEST NUMBER AND OCCURRENCE
USE ARRAY TO FIND THE LARGEST NUMBER AND OCCURRENCE  i have some exercise from my lecturer and I still can't understand about ARRAY. here it is: write a program that reads 10 numbers from the keyboard. find the largest number
Java eft transaction
of this exercise, a customer may have one or more accounts but will only ever have one... number and account type. 5.1 Exercise 1 Implement the findLinkedAccounts... accounts that are linked to the customer. 5.2 Exercise 2 Implement the authorize
discount system.
write a test program to exercise all the classes
Inheretance and polymorphism - Java Beginners
. merry christmas and happy new year to you! Exercise 1.) A point the x-y plane.... ------------------------------------------------------------------------------ Exercise 2.) Every... in Programming Exercise 1, you must derive the class Circle from the class
jQuery to text changes with fading effect
. Brains, like bodies, need exercise to keep fit. If you don't exercise your brain, it will get flabby and useless. Exercise... possible. Books exercise your brain, provide inspiration and fill
Weight Loss Surgery Side Effects
. The best way is regular exercise, healthy diet and regular health check ups. On the contrary, unhealthy diet, irregular timing of intake of food, no exercise... involves exercise and diet check that can keep you healthy for a long time
the discount system.
, for a visit. also write a test program to exercise all the classes
the discount system.
, for a visit. also write a test program to exercise all the classes
Create Web Page with jsp
" instead of "Date.html". This one the simply exercise for your first application JSP. The HTML file we used in the previous exercise. After
Careers in Software Testing
testing awaits your arrival. The whole exercise is to ensure the quality of product... and design. It is an exercise to check the credibility of particular software
Weight Loss
and Ayurvedic medicines. With the help of Yogic exercise you should be able... - An absolute key to Health And Happiness Learn how Exercise can help you
ScriptingTutorials
language.      VBScript Exercise... right into exercise 1 and expose you to the process of using VBScript in your web... first script-enabled web page. In this exercise, you will create an HTML
java - UML
circle designed in programming exercise 4.some of the operations that can
java program - Java Beginners
in this exercise. Notice 2 (Only FoST): Feel free to reuse your own
EclipsePro Test
_TO_REPLACE_1 Automatically generate test cases that exercise each path
GPS in Health Improvement & Physical Training
is playing an important role in making a daily schedule of exercise... on your daily progress of health by preparing a routine of exercise and setting some... there are different ways of uses for safe exercise. Setting goals – If you
Writing First Hello World application in JSP
;. This one the simply exercise for your first application JSP. Just modify file
hi
selections. B/modify the application in the Exercise above (a) so that if the user

Ads