Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


mahamat ali
exercise.
1 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


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.


Advertisement
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
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
Advertisements
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
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
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 Metabolic disorders
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
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
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
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
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
wrapper class concept
of this exercise, initialize a couple of String objects that contain an 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
\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
discount system.
write a test program to exercise all the classes
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
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
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
XML in java - XML
argument.Then modify the program resulting from the this exercise so that it will accept
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
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
jQuery to text changes with fading effect
;p>1.Exercise your brain. Brains, like bodies, need exercise to keep fit. If you don't exercise your brain, it will get flabby and useless. Exercise your brain by reading a lot.</p> <
Weight Loss
and Ayurvedic medicines. With the help of Yogic exercise you should be able... And Happiness Learn how Exercise can help you in controlling obesity? Read more
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
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
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
Advertisements
 

 

 

DMCA.com