Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a java application that displays a series of at least four survey question

ID: 3780605 • Letter: W

Question

Write a java application that displays a series of at least four survey questions ; the survey can be on any social or political topic you like. Each questions should have two possible numeric-choice answers. At the end of the survey, use a dialog box to ask whether a user wants to (1) enter another set of responses to the same questions, or (2) quit. Continue to accept sets of responses until the user chooses to quit. Then display the results of the survey – for each question indicate how many users chose the first option or second option. Format the output in an order way which is user-friendly and is easy to digest.

Explanation / Answer

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class survey {
private static int mark = 0;
public static void start(){
int point;
BufferedReader bReader = new BufferedReader (new
InputStreamReader(System.in));
try {
System.out.println("Question N1: ");
System.out.println("Which is a better platform?");
System.out.println("1: Facebook 2: Twitter");
String question = bReader.readLine();
point = Integer.parseInt(data);
switch(point){
case 1:break;
case 2: mark++;break;
default:break;
}
System.out.println("Question N2: ");
System.out.println("The member of Loksabha holds a time period of;);
System.out.println("1: 5 years 2: 6 years");
question = bReader.readLine();
point = Integer.parseInt(data);
switch(point){
case 1:mark++;break;
case 2:break;
default:break;
}
System.out.println("Question N3: ");
System.out.println(" The minimum age to qulify for the election of Loksabha ");
System.out.println("1: 25 years 2: 18 years");
question = bReader.readLine();
point = Integer.parseInt(data);
switch(point){
case 1:break;
case 2:mark++;break;
default:break;
}
System.out.println("Question N4: ");
System.out.println("the great victoria dsert is located in");
System.out.println("1: Australia 2: West africa");
question = bReader.readLine();
point = Integer.parseInt(data);
switch(point){
case 1:mark++;break;
case 2:break;
default:break;
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args){
System.out.println("Welcome to Quiz!");
start();
System.out.println("Your score is: "+mark);
System.out.println("1. Enter another set of responses to the same set of
questions");
System.out.println("2. Quit");
BufferedReader bReader = new BufferedReader (new
InputStreamReader(System.in));
String question;
try {
question = bReader.readLine();
int point = Integer.parseInt(data);
switch(point){
case 1:mark=0;start();System.out.println("Your point is: "+mark);break;
case 2:System.exit(1);
default:System.exit(1);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote