How to pass a C structure in Python?

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

Was this solution helpful to you?

Just Added Q & A:

Find solution

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.