Closed zafienas closed 3 years ago
//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);
}
}
//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);
}
}
//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);
}
}
FLOWCHART
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
Flowchart
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
//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);
}
}
//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);
}
}
}
//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);
}
}
//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);
}
}
//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);
}
}
// 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);
}
}
//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);
}
}
//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);
}
}
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);
}
}
}
//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);
}
}
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);
}
}
//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);
}
}
// 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);
}
}
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);
}
}
//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);
}
}
//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);
}
}
// 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);
}
}
//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/w5gnpq
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);
}
}
Question:
Submission: