anonymous
  • anonymous
i am to write a code in java that prints out a class participation grade for i clicker scores. the best 75% will be chosen and the max grade is 100%. We r to use JOptionPane to ask the user for the input and to read the values for the total amount of clickers question, the number of correct responses, the number of incorrect responses. Each correct question is 2 points and the wrong question is 1 point.please can u help me ??
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
Sure, I'll help since I just finished my Computer Science exam today. Only problem is, i'm not really understanding what your code is suppose to do. So you have to ask the student the total amount of responses he made the determine how many are right and wrong? Can I have more information on how to determine which are right and wrong?
anonymous
  • anonymous
example1: Enter the number of I clicker questions: 4 Enter the number of correct responses: 3 Enter the number of incorrect responses: 0 You got a class participation grade of 100.0% example2: Enter the number of I clicker questions: 100 Enter the number of correct responses: 0 Enter the number of incorrect responses: 100 You got a class participation grade of 50.0%
anonymous
  • anonymous
example1: Enter the number of I clicker questions: 4 Enter the number of correct responses: 3 Enter the number of incorrect responses: 0 You got a class participation grade of 100.0% example2: Enter the number of I clicker questions: 100 Enter the number of correct responses: 0 Enter the number of incorrect responses: 100 You got a class participation grade of 50.0%

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
What value do you want to determine the number of class participation? Like in your first example, your saying that 3/4 = 100% and then 0/100 = 50%. I'm not really getting how that works.
anonymous
  • anonymous
1 correct answer is 2 points and a wrong answer is 1 point
anonymous
  • anonymous
1 correct answer is 2 points and a wrong answer is 1 point
anonymous
  • anonymous
So all your asking in the program is to determine how many points they get?
anonymous
  • anonymous
yes and the output should show the grade in percentage
anonymous
  • anonymous
yes and the output should show the grade in percentage
anonymous
  • anonymous
Oh lol k now I get what you were asking xD well try this out then: Hmm alright. import javax.swing.*; public class iClicker { public static void main (String[] args) { String n = JOptionPane.showInputDialog("Please enter number of iClicker questions: "); int num = Integer.parseInt(n); String n1 = JOptionPane.showInputDialog("Please enter number of correct responses: "); int num1 = Integer.parseInt(n1); int correct = num1*2; String n2 = JOptionPane.showInputDialog("Please enter number of incorrect responses: "); int num2 = Integer.parseInt(n2); int percentage = correct+num2 / num; JOptionPane.showMessageDialog(null, "You got " + percentage + "%!"); } Hope this helps~
anonymous
  • anonymous
thanks for everything but the output its giving me is not the output i want
anonymous
  • anonymous
thanks for everything but the output its giving me is not the output i want
anonymous
  • anonymous
Could you tell me what your output was? The code I wrote was suppose to give the percentage they got.
anonymous
  • anonymous
when i did dis example2: Enter the number of I clicker questions:100 Enter the number of correct responses: 0 Enter the number of incorrect responses: 100 You got a class participation grade of 50.0% i did not get 50 as the percentage i got 1 as the percentage
anonymous
  • anonymous
when i did dis example2: Enter the number of I clicker questions:100 Enter the number of correct responses: 0 Enter the number of incorrect responses: 100 You got a class participation grade of 50.0% i did not get 50 as the percentage i got 1 as the percentage
anonymous
  • anonymous
Oh my bad, I forgot to convert the decimal to a percentage. Here's the new code that's edited: import javax.swing.*; public class iClicker { public static void main (String[] args) { String n = JOptionPane.showInputDialog("Please enter number of iClicker questions: "); int num = Integer.parseInt(n); String n1 = JOptionPane.showInputDialog("Please enter number of correct responses: "); int num1 = Integer.parseInt(n1); int correct = num1*2; String n2 = JOptionPane.showInputDialog("Please enter number of incorrect responses: "); int num2 = Integer.parseInt(n2); int percentage = correct+num2 / num; int precentage2 = percentage*100; JOptionPane.showMessageDialog(null, "You got " + percentage2 + "%!"); } Try this out~
anonymous
  • anonymous
now the out put is 100 not 50
anonymous
  • anonymous
now the out put is 100 not 50
anonymous
  • anonymous
If this is not what you wanted, i'm really confused on what you want. Please be more specific with your question.
anonymous
  • anonymous
Hopefully this modification of Daebakjoo's code works for you: import javax.swing.*; public class iClicker { static int numQuestions, correctAnswers, incorrectAnswers; static double totalPoints, points, percentage; public static void main (String[] args) { String questions = JOptionPane.showInputDialog("Please enter number of iClicker questions: "); numQuestions = Integer.parseInt(questions); totalPoints = numQuestions*2; String correctAns = JOptionPane.showInputDialog("Please enter number of correct responses: "); correctAnswers = Integer.parseInt(correctAns); points += correctAnswers*2; String incorrectsAns = JOptionPane.showInputDialog("Please enter number of incorrect responses: "); incorrectAnswers = Integer.parseInt(incorrectsAns); points += incorrectAnswers; percentage = (points/totalPoints) * 100; JOptionPane.showMessageDialog(null, "You got " + percentage + "%!"); } }

Looking for something else?

Not the answer you are looking for? Search for more explanations.