What's new

Closed Pa help sa paggawa ng pseudo code.

Status
Not open for further replies.

I am nobody

Forum Guru
Joined
Jan 30, 2016
Posts
4,160
Solutions
2
Reaction
4,967
Points
1,825
So ganito problem

Write a pseudo code that will ask for n number of inputs. Count the occurence of the numbers.

Ex:
una daw mag ask kung ilan ang number: 8
tapos ask the number: 2, 0, 5, 5, 2, 3, 4, 3
Output:
0:1
2:2
3:2
4:1
5:2


Patulong guys.. wala akong maisip paano
 
Kailangan kasi maintindihan muna pano nag wowork yung program tapos aalamin ang algorithms tapos yun.. Convert sa pseudocode..
 
Code:
enter number of inputs
ask user to enter the numbers
store numbers in array

counted numbers = array
for x in length of numbers array:
    occurence = 0

    for y in length of numbers array:
        if numbers[x] == numbers[y]:
            occurence += 1

    if numbers[x] not in counted numbers:
        print(f"number '{numbers[y]}' occurence: {occurence}")
        add numbers[x] in counted numbers
 
Last edited:
ganto output nya

Screenshot_1.jpg
 

Attachments

Status
Not open for further replies.

Similar threads

Back
Top