Please help me in java programming(Combined Repetition and Decision Control Structure)?
-
The program should analyze the result of the followimg 1)input each result(1 or 2)Display the message "Enter your number" on the screen each time the program requests another test result. 2)count the number of the "entered number" each type. 3)Display a summary of the entered number indicating the number of the people who passed and the number who failed. 4)If more than eight students passed the exam,print the message" successful", otherwise print the message"not Successfull". Tips the program will use BufferedReader/Scanner/JOptionPane to get the test result from the user and decision and repetition control structure... here is the sample output: Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):2 Enter your number(1-pass,2-fail):1 Enter your number(1-pass,2-fail):2 Enter your number(1-pass,2-fail):1 Passed:8 Failed: 2 Status:Success!... please help me with this.. please need asap:( advance tnx to whom who can help me and god bless us all..
-
Answer:
Sorry your question is not clear. I am suggesting base on your sample output. import java.util.*; public class xyz { public static void main(String []a) { Scanner S=new Scanner(System.in); int N=S.nextInt(); int pas=0, fail=0; for(int i=0;i<N;i++) { System.out.println("1-pass 2-Fail); int m=S.nextInt(); if(m==1)pas++; else fail--; } System.out.println("Passed="+pas); System.out.println("Failed="+fail); if(pas>=8) System.out.println("Success"); else System.out.println("Unsuccess"); } }
Rexa at Yahoo! Answers Visit the source
Related Q & A:
- Why cant i view my contacts display image? please help if you know ,thanks?Best solution by Yahoo! Answers
- The pores on my face are wideninf by the minute. Please help me so that I can have them the normal size?Best solution by Yahoo! Answers
- I did something really bad and now i need help please help me.Best solution by Yahoo! Answers
- Help with TV show, please help?Best solution by Yahoo! Answers
- Computer Science Java Programming?Best solution by AllExperts
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.