zafienas / SSK3100-G14

0 stars 0 forks source link

3) Largest Number #15

Closed zafienas closed 3 years ago

zafienas commented 3 years ago

Question:

image

Submission:

  1. Flowchart
  2. Java source code
  3. Screenshot of the output
nadiahisml commented 3 years ago

image

//Developer: Nadiah Ismail
//Task: Occurrence of max numbers

import java.util.Scanner;

public class OccurrenceMaxNum {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int max, num;

        System.out.print("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            }
            else if (num == max) {
                count++;
            }
        } while (num != 0);

        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);

    }
}

image

FarhanaYusri commented 3 years ago
//Developer: Farhana Yusri
//Task: Largest Number
import java.util.Scanner;

public class Slide89 {

        public static void main(String[] args) {

            Scanner input = new Scanner(System.in);

            int num, maxnum;

            System.out.print("Enter numbers: ");
            maxnum = input.nextInt();
            int count = 1;

            do {
                num = input.nextInt();

                if (num > maxnum) {
                    maxnum = num;
                    count = 1;
                }
                else if (num == maxnum) {
                    count++;
                }
            } while (num != 0);

            System.out.println("The largest number is " + maxnum);
            System.out.println("The occurrence count of the largest number is " + count);

        }
}

Flowchart maxnum Largest Num

nrhzrhrsli commented 3 years ago
//Developer : Hazirah Rosli
//Task : Question 3

import java.util.Scanner;

public class Question3 {
    public static void main(String [] args){

        Scanner input = new Scanner(System.in);

        int max, num;

        System.out.println("Enter numbers:");
        max = input.nextInt();
        int count = 1;

        do{
            num = input.nextInt();

            if (num > max){
                max = num;
                count = 1;
            }
            else if (num == max){
                count++;
            }
        } while (num != 0);

        System.out.println("The largest numbers is " + max);
        System.out.println("The occurence count of the largest numbers is " + count);

    }
}

image LAB QUESTION3

WanNurfarah commented 3 years ago

FLOWCHART MaxNum

JAVA SOURCE CODE

//Developer: Wan Nurfarah Binti Wan Zulkifli
//Task: Occurrence of Max Numbers
import java.util.Scanner;

public class MaxNum {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        //request numbers from user
        System.out.print("Enter Numbers = ");

        //declaration
        int max = scanner.nextInt();
        int count = 1;
        int num;

        //do while loop
        do {
            num = scanner.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            }
            else if (num == max){
                count++;
            }
        } while (num != 0);   // assume that the input ends with number 0

        //print results
        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);
    }
}

OUTPUT

MaxNum (47)
Farhanazul98 commented 3 years ago

Flowchart Max Number

Coding

//Developer: PrincessHana
import java.util.Scanner;

public class MaxNumber {
    public static void main (String [] args ) {
        int max, number;

        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter numbers: " );
        max = scanner.nextInt();
        int count = 1;

        do {
            number = scanner.nextInt();
            if (number > max) {
                max = number;
                count = 1;
            }
            else if (number == max) {
                count++;
            }

        } while (number != 0);
        System.out.println("The largest number is " + max );
        System.out.println("The occurrence count of the largest number is " + count);
    }

} 

Output

image

FtyRzd commented 3 years ago

image

//Developer : Siti Nurfatihah bt Rozaidi (202934)
//Task : OccurenceOfMaxNumber
import java.util.Scanner;
public class MaxNumber {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        // Prompt the user to enter number
        int max;
        int numbers;

        System.out.print("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        // Assume that the input ends with number 0
        do {
            numbers = input.nextInt();

            if (numbers > max) {
                max = numbers;
                count = 1;
            }
            else if (numbers == max) {
                count++;
            }
        } while (numbers != 0);

        // Display to results
        System.out.println("The largest number is " +max);
        System.out.println("The occurrence count of the largest number is " +count);
    }
}

image

Masturah29 commented 3 years ago
//Developer ; Masturah Binti Mokhtar
//Task ; Occurence

import java.util.Scanner;

public class occurrence {
    public static void main(String args[]) {

        {int max=0,count=1,num;

            Scanner scanner = new Scanner(System.in);
            System.out.print("Enter numbers :");
            num = scanner.nextInt();

            while(num!=0)
            {if(num>max)
            {count=1;
                max=num;
            }

            else if (max==num)
                count++;
                num=scanner.nextInt();
            }

            System.out.println("The largest number is "+max+" The occurrence count of the largest number is "+count);
        }
    }
}

occurence

occurenceiii

Syazimah06 commented 3 years ago
//Developer: SITI NUR SYAZIMAH BINTI ABU (203023)
//Task: Occurence of max number

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        int num, max;

        Scanner input = new Scanner(System.in);
        System.out.print("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max)
            {
                max = num;
                count = 1;
            }
            else if (num == max)
            {
                count++;
            }
        }while (num != 0);

        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);
    }
}

OccurenceOfMaxNum OccurenceOfMaxNum

NurHanisHaziqah commented 3 years ago

unnamed0

//Developer: NUR HANIS HAZIQAH BINTI HISHAM HAIZAD(202936)
//TASK : LARGEST NUMBER
package com.company;

import java.util.Scanner;

public class LargestNumber {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int num, max;

        System.out.print(" Enter numbers : ");
        max = scanner.nextInt();
        int count = 1;

        do {
            num = scanner.nextInt();

            if (num > max) {
                max = num;
               count = 1;
            } else if (num == max) {
                count++;
            }
        }while (num != 0) ;

            System.out.println(" The Largest number : " + max);
            System.out.println(" The occurrence count of the largest num is " + count);

        }

    }

Screenshot_141

NoorHusna202271 commented 3 years ago

image

//Developer:Noor Husna
//Task: Occurrence of max numbers

import java.util.Scanner;

public class OccurrenceMaxNUm {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int max, num;

        System.out.print("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            }
            else if (num == max) {
                count++;
            }
        } while (num != 0);

        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);

    }
}

image

izzatisyahzanani16 commented 3 years ago

Occurance Numbers


// Developer : Nurul Izzati Syahzanani Binti Farooq Azam
// Task : Pyramid Pattern

import java.util.Scanner;

public class OccuranceMaxNum {
    public static void main (String [] args){

        Scanner input = new Scanner (System.in);

        int max, num;

        System.out.print("Enter Numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            } else if (num == max) {
                count++;
            }
        }while (num != 0);

            System.out.println("The Largest Number is " + max);
            System.out.println("The Occurrence Count Of The Largest Number is " + count);

    }
}

image

elyamaisarah commented 3 years ago
//developer: elya maisarah (202487)
//task: occurence of the largest number
import java.util.Scanner;
    public class largestNumber {
        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);

            int num, largest;

            System.out.print("Enter numbers: ");
            largest = input.nextInt();
            int count = 1;

            do {
                num = input.nextInt();
                if (num > largest) {
                    largest = num;
                    count = 1;
                }
                else if (num == largest) {
                    count++;
                }
            } while (num != 0);

            System.out.println("The largest number is " + largest);
            System.out.println("The occurrence count of the largest number is " + count);

        }
    }

largest num ss largest num final

AzimArifin commented 3 years ago

//Developer: Azim Arifin
//Task: Number

import java.util.Scanner;

public class NumberPractice {
    public static void main (String [] args ) {
        int number,max;

        Scanner input= new Scanner(System.in);
        System.out.print("ENTER THE NUMBERS:" );
        max = input.nextInt();
        int count = 1;

            do { number = input.nextInt();
            if (number > max) {
                max = number;
                count = 1;
            }
            else if (number == max) {
                ++count;
            }

        } while (number != 0);

        //Display the results
        System.out.println("The largest number is " + max );
        System.out.println("The occurrence count of largest number is " + count);
    }

}
AzimArifin commented 3 years ago

Screenshot_6 Screenshot_7

fakhiraadriana commented 3 years ago
import java.util.Scanner;
//Developer name=Nur Fakhira Adriana
public class soalan3 {
    public static void main(String[] strings) {
        Scanner in = new Scanner(System.in);
        {
            int max = 0, count = 1, number;
            System.out.print("Enter number: ");
            number = in.nextInt();
            while (number != 0) {
                if (number > max) {
                    count = 1;
                    max = number;
                } else if (max == number)
                    count++;
                number = in.nextInt();
            }
            System.out.println("The largest number is " + max );
            System.out.println("The occurrence count of the largest number is " + count);
        }
    }
}

while loop soalan3 Screenshot (167)

haswani203024 commented 3 years ago
//Developer: Nurul Haswani Bt Ariffin
//Matric: 203024

import java.util.Scanner;

public class n03 {

    public static void main(String[] args) {

            Scanner input = new Scanner(System.in);

            int max, num;

            System.out.print("Enter numbers: ");
            max = input.nextInt();
            int count = 1;

            do {
                num = input.nextInt();

                if (num > max) {
                    max = num;
                    count = 1;
                }
                else if (num == max) {
                    count++;
                }
            } while (num != 0);

            System.out.println("The largest number is " + max);
            System.out.println("The occurrence count of the largest number is " + count);

        }
    }

image image

azeelahyasmin00 commented 3 years ago

image

import java.util.Scanner;

//Developer: Azeelah yasmin Bt Azlee
//Matric: 202935

public class question3{

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int max, num;

        System.out.print("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            }
            else if (num == max) {
                count++;
            }
        } while (num != 0);

        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);

    }
}

image

SorfinaNorly commented 3 years ago

Question3

//Developer: Norshasha Sorfina
//Task : Largest Number, Occurrence count

import java.util.Scanner;

public class Question3 {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int max;
        int num;

        System.out.println("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max)
            {
                max = num;
                count = 1;
            }
            else if (num == max)
            {
                count++;
            }
        }while (num != 0) ;

            System.out.println("The largest number is " + max);
            System.out.println("The occurrence count of the largest number is " + count);

    }
}

Question3 Output

shazmi10 commented 3 years ago

image

// Developer : Muhammad Shazmi Bin Mohd Basri
// Task : Find the occurrence number

import java.util.Scanner;

public class OccurrenceNumber {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int max, num;

        System.out.print("Enter numbers: ");
        max = input.nextInt();
        int count = 1;

        //do while loop
        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            }
            else if (num == max){
                count++;
            }
        } while (num != 0); 

        System.out.println("The largest number is " + max);
        System.out.println("The occurrence count of the largest number is " + count);
    }
}

image

arifqhuzairie commented 3 years ago

image

import java.util.Scanner;
// developer: arif qhuzairie
// task: largest number
public class largestnum {
    public static void main (String [] args ) {
        int number,max;

        Scanner input= new Scanner(System.in);
        System.out.print("ENTER THE NUMBERS:" );
        max = input.nextInt();
        int count = 1;

        do { number = input.nextInt();
            if (number > max) {
                max = number;
                count = 1;
            }
            else if (number == max) {
                ++count;
            }

        } while (number != 0);

        //Display the results
        System.out.println("The largest number is " + max );
        System.out.println("The occurrence count of largest number is " + count);
    }

}

image

ajim1619 commented 3 years ago

//Developer: Abdul Azim (203198)
//Task: Occurrence of Max Numbers

import java.util.Scanner;

public class OccurMaxNum {
    public static void main (String [] args){

        Scanner input = new Scanner (System.in);

        int max, num;

        System.out.print("Enter Any Numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            } else if (num == max) {
                count++;
            }
        }while (num != 0);

        System.out.println("The Largest Number is " + max);
        System.out.println("The Occurrence Count of The Largest Number is " + count);

    }
}

Flowchart OccurMaxNum OccurMaxNum

DenzKaizer commented 3 years ago

Largest Number

//Danish 204596
//Largest number
import java.util.Scanner;

public class LargestNum {
    public static void main(String[] args) {

        Scanner input = new Scanner (System.in);

        int max, num;

        System.out.print("Enter Any Numbers: ");
        max = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > max) {
                max = num;
                count = 1;
            } else if (num == max) {
                count++;
            }
        }while (num != 0);

        System.out.println("The Largest Number is " + max);
        System.out.println("The Occurrence Count of The Largest Number is " + count);

    }
}

Screenshot_1

ikmalhafiq commented 3 years ago

Largest Number FC


// Developer: Ikmal Hafiq
// Task: Largest Number

import java.util.Scanner;

public class LargestNumber {
    public static void main (String [] args ) {
        int number,max;

        Scanner input= new Scanner(System.in);
        System.out.print("ENTER THE NUMBERS:" );
        max = input.nextInt();
        int count = 1;

        do { number = input.nextInt();
            if (number > max) {
                max = number;
                count = 1;
            }
            else if (number == max) {
                ++count;
            }

        } while (number != 0);

        //Display the results
        System.out.println("The largest number is " + max );
        System.out.println("The occurrence count of largest number is " + count);
    }

}

Largest Number

Lyanaazwanis99 commented 3 years ago
//Developer: Lyana Azwanis
//Task: Max number
import java.util.Scanner;
public class Nestedloop31 {
        public static void main(String[] args) {

            Scanner input = new Scanner(System.in);

            int max, num;

            System.out.print("Enter numbers: ");
            max = input.nextInt();
            int count = 1;

            do {
                num = input.nextInt();

                if (num > max) {
                    max = num;
                    count = 1;
                } else if (num == max) {
                    count++;
                }
            } while (num != 0);

            System.out.println("The largest number is " + max);
            System.out.println("The occurrence count of the largest number is " + count);
        }
    }

https://prnt.sc/w5efpc


https://prnt.sc/w5gnpq
batrisyaalwani commented 3 years ago

flowchart 4

package com.company;
//name: batrisya alwani
//task: largest number
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int num, maxnum;

        System.out.print("Enter numbers: ");
        maxnum = input.nextInt();
        int count = 1;

        do {
            num = input.nextInt();

            if (num > maxnum) {
                maxnum = num;
                count = 1;
            }
            else if (num == maxnum) {
                count++;
            }
        } while (num != 0);

        System.out.println("The largest number is " + maxnum);
        System.out.println("The occurrence count of the largest number is " + count);

    }
}

Screenshot (121)