What's new

JAVA HELP PO

jerylsev

Grasshopper
Joined
Nov 16, 2021
Posts
2
Reaction
2
Points
13
create a program that asks the user for the number of male and female students registered in a class/section. The program should display the total number of students and the percentage of males and females in the class.



Sample output:

Enter the number of males: 36
Enter the number of females: 17
Number of students = 53
Male = 67.92%
Female = 32.08%
 
ts I will not give the code but I will give the basic flow and formula. gamit ng input stream (ex. scanner) tapos store mo sa variables. sa pagkuha ng percentage ng male and female is the number of male/female divided by the total number of students in a class multiplied by 100. Sorry ts ha pero kung gusto mo talaga magpatuloy sa field ng ICT kailangan mo gawin eto nang ikaw lang. Basic of the basic po ito ts.
 
Same lang to dun sa Activity na pinapagawa nung nag papatulong student ng STI, 1st years

ito hint,set the class and use scanner tulad nung suggestion ni jokerger25 import and declare it
then need mo na initialize data type ng kada variable kung saan ito e stored (ex. int float double for numbers) pero since may percentage involve either use float or double

after mo ma initialize variable ask the user kung ano e input dun papasok kung bat need ng scanner println ka lang and ask (ex. System.out.println("enter question") then save mo kung saan variable sya ipapasok since dalawang data kailangan dalawa then gagawin mo pag store ng data after asking and storing value )

ilalagay mo dito yung formula nung pagkuha ng percentage kasi may data kana galing sa taas yung total muna madali lang yan (c = a+b) then sa percentage since there are 100% divide mo lang and multiply formula example formula for getting % ((d=(a / c)*100)

after you get the logic println mo nalang yung variable and show

medyo magulo yan pag di mo tlga nasundan yung mga past na pinagawa sainyo kaya practisin mo na basic lang talaga yan pag na gets mo, matatawa ka nalang Goodluck
 

Similar threads

Back
Top