SlideShare a Scribd company logo
1 of 2
import java.util.Scanner;
class Kadai2{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
Quiz q = new Quiz();// C X ^ X� ��� � ��� ��
for(int i = 0; i<6; i++){
}
q.judge();// f�������
if(q.score != 0){//1��ȏ 㐳�ⵂ Ă���㐳
System.out.println("nnt"+q.score+" ␳ ł ");// o� ��� � ������� ��
邩�ǂ���
}
else {//1 г�� �ⵂ Ă��Ȃ��㐳
System.out.println("nnt S s ł ");// o� �� ���� � �������� ��
邩�ǂ���
}
int flag = sc.nextInt();
㐳
q.miss();// ␳ o������� �� �
}
}
class Quiz{
int score = 0;// i [�������� � ����ϐ�
int[] right = {1,0,1,0,0,1};// ␳i p j������� �Ք����� �
String[] data = new String[6];// i [ z���� � ���� ��
int ans[] = new int[6];// ␳ i [ z� ��ʂ�� � ��� ��
Quiz(){// e i [���� �� �
";Ȃ�
";Ȃ�
f���邽�
}
void quiz(int a){// o���� ��
}
void answer(int a){// ␳ i␳ [� ��ʂ��
Scanner sc = new Scanner(System.in);
ans[a] = sc.nextInt();
}
void answer(int a){//‰ñ‰‰‰‰‰Ê‰ð‰i‰[
Scanner sc = new Scanner(System.in);
ans[a] = sc.nextInt();
}
void judge(){//‰³‰‰‰ð‰»‰f
for(int i= 0;i<6;i++){
if(ans[i] == right[i])//‰³‰µ‰¢‰ñ‰‰‰ª‰ü‰Í‰³‰ê‰Ä‰¢‰é‰ê‰‰
score++;//‰³‰‰‰‰‰É‰P‰ð‰«‰·
}
}
void miss(){//‰³‰µ‰¢‰ñ‰‰‰ð‰o‰Í
for(int i = 0; i < 6;i++){
System.out.println("nnt"+data[i]+"["+right2[i]+"]");
}
}
}

More Related Content

What's hot (10)

Practice programs
Practice programsPractice programs
Practice programs
 
String slide
String slideString slide
String slide
 
Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018
 
Head First Java Chapter 1
Head First Java Chapter 1Head First Java Chapter 1
Head First Java Chapter 1
 
123
123123
123
 
The Ring programming language version 1.6 book - Part 39 of 189
The Ring programming language version 1.6 book - Part 39 of 189The Ring programming language version 1.6 book - Part 39 of 189
The Ring programming language version 1.6 book - Part 39 of 189
 
Boxing & unboxing
Boxing & unboxingBoxing & unboxing
Boxing & unboxing
 
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time API
 
Ann
AnnAnn
Ann
 
iOS UI Debugging
iOS UI DebuggingiOS UI Debugging
iOS UI Debugging
 

Similar to クイズプログラム

FileName EX06_1java Programmer import ja.pdf
FileName EX06_1java Programmer  import ja.pdfFileName EX06_1java Programmer  import ja.pdf
FileName EX06_1java Programmer import ja.pdf
actocomputer
 
StudentData.javaimport java.util.Scanner; public class Student.pdf
StudentData.javaimport java.util.Scanner; public class Student.pdfStudentData.javaimport java.util.Scanner; public class Student.pdf
StudentData.javaimport java.util.Scanner; public class Student.pdf
anokhijew
 
Java questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdfJava questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdf
forwardcom41
 
Im getting List Full when I try to add 2nd student.Driver..pdf
Im getting List Full when I try to add 2nd student.Driver..pdfIm getting List Full when I try to add 2nd student.Driver..pdf
Im getting List Full when I try to add 2nd student.Driver..pdf
forwardcom41
 
LECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdf
LECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdfLECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdf
LECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdf
ShashikantSathe3
 

Similar to クイズプログラム (15)

java slip for bachelors of business administration.pdf
java slip for bachelors of business administration.pdfjava slip for bachelors of business administration.pdf
java slip for bachelors of business administration.pdf
 
Java programs
Java programsJava programs
Java programs
 
FileName EX06_1java Programmer import ja.pdf
FileName EX06_1java Programmer  import ja.pdfFileName EX06_1java Programmer  import ja.pdf
FileName EX06_1java Programmer import ja.pdf
 
import java.util.Scanner; public class Palin { public static v.pdf
import java.util.Scanner; public class Palin { public static v.pdfimport java.util.Scanner; public class Palin { public static v.pdf
import java.util.Scanner; public class Palin { public static v.pdf
 
StudentData.javaimport java.util.Scanner; public class Student.pdf
StudentData.javaimport java.util.Scanner; public class Student.pdfStudentData.javaimport java.util.Scanner; public class Student.pdf
StudentData.javaimport java.util.Scanner; public class Student.pdf
 
Java questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdfJava questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdf
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
Im getting List Full when I try to add 2nd student.Driver..pdf
Im getting List Full when I try to add 2nd student.Driver..pdfIm getting List Full when I try to add 2nd student.Driver..pdf
Im getting List Full when I try to add 2nd student.Driver..pdf
 
ISCP internal.pdf
ISCP internal.pdfISCP internal.pdf
ISCP internal.pdf
 
Java programs
Java programsJava programs
Java programs
 
LECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdf
LECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdfLECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdf
LECTURE 2 MORE TYPES, METHODS, CONDITIONALS.pdf
 

Recently uploaded

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 

クイズプログラム

  • 1. import java.util.Scanner; class Kadai2{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); Quiz q = new Quiz();// C X ^ X� ��� � ��� �� for(int i = 0; i<6; i++){ } q.judge();// f������� if(q.score != 0){//1��ȏ 㐳�ⵂ Ă���㐳 System.out.println("nnt"+q.score+" ␳ ł ");// o� ��� � ������� �� 邩�ǂ��� } else {//1 г�� �ⵂ Ă��Ȃ��㐳 System.out.println("nnt S s ł ");// o� �� ���� � �������� �� 邩�ǂ��� } int flag = sc.nextInt(); 㐳 q.miss();// ␳ o������� �� � } } class Quiz{ int score = 0;// i [�������� � ����ϐ� int[] right = {1,0,1,0,0,1};// ␳i p j������� �Ք����� � String[] data = new String[6];// i [ z���� � ���� �� int ans[] = new int[6];// ␳ i [ z� ��ʂ�� � ��� �� Quiz(){// e i [���� �� � ";Ȃ� ";Ȃ� f���邽� } void quiz(int a){// o���� �� } void answer(int a){// ␳ i␳ [� ��ʂ�� Scanner sc = new Scanner(System.in); ans[a] = sc.nextInt(); }
  • 2. void answer(int a){//‰ñ‰‰‰‰‰Ê‰ð‰i‰[ Scanner sc = new Scanner(System.in); ans[a] = sc.nextInt(); } void judge(){//‰³‰‰‰ð‰»‰f for(int i= 0;i<6;i++){ if(ans[i] == right[i])//‰³‰µ‰¢‰ñ‰‰‰ª‰ü‰Í‰³‰ê‰Ä‰¢‰é‰ê‰‰ score++;//‰³‰‰‰‰‰É‰P‰ð‰«‰· } } void miss(){//‰³‰µ‰¢‰ñ‰‰‰ð‰o‰Í for(int i = 0; i < 6;i++){ System.out.println("nnt"+data[i]+"["+right2[i]+"]"); } } }