🔒 Closed Pa help po java language

Status
Not open for further replies.

mattdemon24444

Eternal Poster
Pa help naman po dito sa mga may mabubuting puso dyan🥺

Problem Description

Krispy Kreme is giving away one free donut for each customer today.

They suspect that some customers are trying to get more than their fair share of donuts by lining up more than once.

Try to find these greedy customers so that Krispy Kreme can give away the sweet, soft and glazed donuts to the rightful owners.







Input
1. The number of customers

Constraints
The value is > 0.
2. The customers
Constraints
The value is within the range: 0 <= customer number <= 500.


Output
The first line will contain a message prompt to input the number of customers. The succeeding lines will contain message prompts to input the customers. The last line list down the customers that appeared more than once, in ascending order. Print "HONEST CUSTOMERS" if there are no duplicating customers.
Enter·the·number·of·customers:·4
Customer·number:·5
Customer·number:·6
Customer·number:·6
Customer·number:·5
Duplicates:·
Customer·#5
Customer·#6
========================================================
TEST CASES
Test Case #1

Enter the number of customers: 4
Customer number: 5
Customer number: 6
Customer number: 6
Customer number: 5
Duplicates:
Customer #5
Customer #6
Test Case #2
Enter the number of customers: 8
Customer number: 6
Customer number: 21
Customer number: 42
Customer number: 33
Customer number: 56
Customer number: 23
Customer number: 12
Customer number: 6
Duplicates:
Customer #6
Test Case #3
Enter the number of customers: 5
Customer number: 5
Customer number: 2
Customer number: 3
Customer number: 10
Customer number: 4
HONEST CUSTOMERS
Test Case #4

Enter the number of customers: 6
Customer number: 0
Customer number: 1
Customer number: 2
Customer number: 1
Customer number: 2
Customer number: 0
Duplicates:
Customer #0
Customer #1
Customer #2
Test Case #5
Enter the number of customers: 7
Customer number: 20
Customer number: 20
Customer number: 21
Customer number: 21
Customer number: 20
Customer number: 500
Customer number: 500
Duplicates:
Customer #20
Customer #21
Customer #500
Test Case #6
Enter the number of customers: 3
Customer number: 444
Customer number: 444
Customer number: 444
Duplicates:
Customer #444
 
  • Use loop
  • Use an array to store data during input and initialize them to 0
  • Each time the program asks for customer #, your program should check if the customer # (by index) contains more than 0. If the index value is more than 0, then the customer is already served with donuts.
 
  • Use loop
  • Use an array to store data during input and initialize them to 0
  • Each time the program asks for customer #, your program should check if the customer # (by index) contains more than 0. If the index value is more than 0, then the customer is already served with donuts.
May codes po ba kayo kung pwede po mahingi? Thank you po
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 1K
    Views
  • 3
    Participants
Last reply from:
Connies

Online now

Members online
520
Guests online
1,273
Total visitors
1,793

Forum statistics

Threads
2,277,853
Posts
28,979,277
Members
1,229,112
Latest member
rosearugay
Back
Top