Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Patulong sa Program ko. (Newblood ako sa Programming)

VirusExcelL

Proficient
Advanced Member
Messages
221
Reaction score
1
Points
28
Pa help naman kung paano mag repeat ng program.
Need ko kasi ipasa mamaya. And wala talaga ako Idea or mahanap sa google.
Hope matulungan nyo ako.
Code:
import java.util.Scanner;
public class Hello {
    
    public static void main(String[] args) {
    	
    	
    	System.out.println ("Welcome To A Quiz Game\n");
    	int c =0;
    	
    	Scanner scan = new Scanner (System.in);
    	
    	System.out.println ("Who is the Philippine Hero?" );
    	System.out.println ("A. Andres Bonifacio");
    	System.out.println ("B. Lapu Lapu");
    	System.out.println ("C. Jose Rizal");
    	System.out.println ("D. Apolinario Mabini");
    	
    	
    	String in;
    	System.out.print("Input your Answer Here:");
    	in = scan.nextLine();
    	
    	if (in.equals("C"))
    		
    	{
    		do
    		{   
    			
    			System.out.println ("Correct\n");
    			
    			
    			c--;
    			System.out.print ("Do you want to Repeat the Quiz?: ");
    			
    		}
    		
    		while (c>1);
    	}
    	else
    	{
    		System.out.println ("Wrong\n");
    		
    	}
    	
    }
}
Eto po yung Output nya.
View attachment 320528
Kailangan ko kasi I repeat yung Quiz Without Process Complete.
Salamat talaga sa tulong nyo.
 

Attachments

  • sadsa.jpg
    sadsa.jpg
    24.5 KB · Views: 31
Code:
import java.util.Scanner;
public class Hello {
    
    public static void main(String[] args) {
    	
    	
    	System.out.println ("Welcome To A Quiz Game\n");
    	int c =0;
    	
    	Scanner scan = new Scanner (System.in);
   
 do
    {    	
    	System.out.println ("Who is the Philippine Hero?" );
    	System.out.println ("A. Andres Bonifacio");
    	System.out.println ("B. Lapu Lapu");
    	System.out.println ("C. Jose Rizal");
    	System.out.println ("D. Apolinario Mabini");
    	
    	
    	String in;
    	System.out.print("Input your Answer Here:");
    	in = scan.nextLine();
    	
    	if (in.equals("C"))
    		
    	{
    		System.out.println ("Correct\n");   		
    	}
    	else
    	{
    		System.out.println ("Wrong\n");
    		
    	}
    	
System.out.print ("Do you want to Repeat the Quiz?: ");
repeat = scan.nextLine();
}
    		
    		while (repeat.equals("Y"));
    }
}

pa check error n lng di ko kabisado syntax ng java sana tumakbo :thumbsup:
 
Last edited:
Parang imposible ata to.
Suko na ako.
Anyway, Thanks sa help. malapit na kasi deadline 4:00pm
Mag shishift nalang ako ng kurso.
 
Parang imposible ata to.
Suko na ako.
Anyway, Thanks sa help. malapit na kasi deadline 4:00pm
Mag shishift nalang ako ng kurso.


Di mo lang nadeclare ung repeat .. tsk wag agad agad susuko TS :)

Code:
import java.util.Scanner;
public class Hello {
    
    public static void main(String[] args) {
    	
    	String repeat;
    	System.out.println ("Welcome To A Quiz Game\n");
    	int c =0;
    	
    	Scanner scan = new Scanner (System.in);
   
 do
    {    	
    	System.out.println ("Who is the Philippine Hero?" );
    	System.out.println ("A. Andres Bonifacio");
    	System.out.println ("B. Lapu Lapu");
    	System.out.println ("C. Jose Rizal");
    	System.out.println ("D. Apolinario Mabini");
    	
    	
    	String in;
    	System.out.print("Input your Answer Here:");
    	in = scan.nextLine();
    	
    	if (in.equals("C"))
    	{
    		System.out.println ("Correct\n");   		
    	}
    	else
    	{
    		System.out.println ("Wrong\n");
    	}
    	
        System.out.print ("Do you want to Repeat the Quiz?: ");
        repeat = scan.nextLine();
     }
    		
    		while (repeat.equals("Y"));
    }
}
 
Last edited:
Di mo lang nadeclare ung repeat .. tsk wag agad agad susuko TS :)

Code:
import java.util.Scanner;
public class Hello {
    
    public static void main(String[] args) {
    	
    	String repeat;
    	System.out.println ("Welcome To A Quiz Game\n");
    	int c =0;
    	
    	Scanner scan = new Scanner (System.in);
   
 do
    {    	
    	System.out.println ("Who is the Philippine Hero?" );
    	System.out.println ("A. Andres Bonifacio");
    	System.out.println ("B. Lapu Lapu");
    	System.out.println ("C. Jose Rizal");
    	System.out.println ("D. Apolinario Mabini");
    	
    	
    	String in;
    	System.out.print("Input your Answer Here:");
    	in = scan.nextLine();
    	
    	if (in.equals("C"))
    	{
    		System.out.println ("Correct\n");   		
    	}
    	else
    	{
    		System.out.println ("Wrong\n");
    	}
    	
        System.out.print ("Do you want to Repeat the Quiz?: ");
        repeat = scan.nextLine();
     }
    		
    		while (repeat.equals("Y"));
    }
}

ideclare mo kasi sa labas ng do while loop mo ung repeat ,,

String repeat = "";

then, ibalik mo sa dati ung

repeat = scan.nextLine();
 
Parang imposible ata to.
Suko na ako.
Anyway, Thanks sa help. malapit na kasi deadline 4:00pm
Mag shishift nalang ako ng kurso.

haha kakatuwa si ts. gnyan din ako dati mashift din sana ako ng course kaso programming ang nagsalba sakin at ituloy ko ung course. ganun tlga buhay. :salute:

okay na yan ..
View attachment 1213617

sana umabot ka . kakabasa ko lang kasi ng thread mo.

d ko kasi alam ang syntax ng java kaso nagtry lang ako dahil pareho lng nmn ang logic ng programming. hehe
sana mabait ung instructor or absent. assignment lng nmn ata :lol:
 
Last edited:
Sorry bad habit ko kasi sumuko. Anyway, Salamat sa motivation nyo. Itutuloy ko parin tong course. Di ko kasi expect na mahirap pala tong course na to. Tbh, di kasi naturo samin ng maayos kaya naguguluhan ako mag declare.
Salamat ulit sainyo mga paps :)

- - - Updated - - -

haha kakatuwa si ts. gnyan din ako dati mashift din sana ako ng course kaso programming ang nagsalba sakin at ituloy ko ung course. ganun tlga buhay. :salute:



d ko kasi alam ang syntax ng java kaso nagtry lang ako dahil pareho lng nmn ang logic ng programming. hehe
sana mabait ung instructor or absent. assignment lng nmn ata :lol:
Grabe kasi tong intructor namin. Wala kami ka alam alam sa assignment na to. Ewan ko nga ilan lang nakapasa nyan. :(
 
Back
Top Bottom