SlideShare a Scribd company logo
1 of 1
Download to read offline
(I'm trying to make a menu that repeats unless you enter 4. How do I get this to repeat the
printMenu()Method that prints the options and keeps repeating options until you hit exit #4?)
public class Main { public static void main(String[] args) { Scanner input = new
Scanner(System.in); printMenu(); int x = input.nextInt(); if ( x == 1) countPunctuation(); if ( x
== 2) charactertoBinary(); if ( x == 3) binaryToCharacter(); if (x == 4) System.out.print("You
have chosen Exit. Goodbye"); if (x > 4) System.out.print("Error"); printMenu(); if (x < 1)
System.out.print("Error"); } // Create first Method. Print Menu*** public static void
printMenu(){ String newline = System.getProperty("line.separator"); System.out.print("Enter '1'
to count punctuation symbols in a String." + newline + "Enter '2' to convert characters to binary."
+ newline + "Enter '3' to convert 8-bit binary to a character." + newline + "Enter '4' to
exit."+newline +"Enter option:"); }

More Related Content

Similar to (I'm trying to make a menu that repeats unless you enter 4- How do I g.pdf

KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerAiman Hud
 
Trace the following part of codes step by step- Show exactly what it w.docx
Trace the following part of codes step by step- Show exactly what it w.docxTrace the following part of codes step by step- Show exactly what it w.docx
Trace the following part of codes step by step- Show exactly what it w.docxgtameka
 
I need to create a data type that implement the following interface -.docx
I need to create a data type that implement the following interface -.docxI need to create a data type that implement the following interface -.docx
I need to create a data type that implement the following interface -.docxmckerliejonelle
 
For the following I have finished most of this question but am havin.pdf
For the following I have finished most of this question but am havin.pdfFor the following I have finished most of this question but am havin.pdf
For the following I have finished most of this question but am havin.pdfarihantplastictanksh
 
Here is the code for youimport java.util.Scanner; import java.u.pdf
Here is the code for youimport java.util.Scanner; import java.u.pdfHere is the code for youimport java.util.Scanner; import java.u.pdf
Here is the code for youimport java.util.Scanner; import java.u.pdfanithareadymade
 
Hello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfHello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfarchiesgallery
 
Modify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdfModify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdfarihantplastictanksh
 
import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdfangelsfashion1
 
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..pdfforwardcom41
 
import java.util.Scanner;public class HornersPolynomial {   .pdf
import java.util.Scanner;public class HornersPolynomial {   .pdfimport java.util.Scanner;public class HornersPolynomial {   .pdf
import java.util.Scanner;public class HornersPolynomial {   .pdfaptex1
 
Sharable_Java_Python.pdf
Sharable_Java_Python.pdfSharable_Java_Python.pdf
Sharable_Java_Python.pdfICADCMLTPC
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptMahyuddin8
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfapleather
 
Java Program- Wrtie a Fraction classGiven the main method of a dri.pdf
Java Program- Wrtie a Fraction classGiven the main method of a dri.pdfJava Program- Wrtie a Fraction classGiven the main method of a dri.pdf
Java Program- Wrtie a Fraction classGiven the main method of a dri.pdfarchanaemporium
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...Hiraniahmad
 

Similar to (I'm trying to make a menu that repeats unless you enter 4- How do I g.pdf (20)

Java file
Java fileJava file
Java file
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
 
Trace the following part of codes step by step- Show exactly what it w.docx
Trace the following part of codes step by step- Show exactly what it w.docxTrace the following part of codes step by step- Show exactly what it w.docx
Trace the following part of codes step by step- Show exactly what it w.docx
 
I need to create a data type that implement the following interface -.docx
I need to create a data type that implement the following interface -.docxI need to create a data type that implement the following interface -.docx
I need to create a data type that implement the following interface -.docx
 
09. Java Methods
09. Java Methods09. Java Methods
09. Java Methods
 
For the following I have finished most of this question but am havin.pdf
For the following I have finished most of this question but am havin.pdfFor the following I have finished most of this question but am havin.pdf
For the following I have finished most of this question but am havin.pdf
 
Here is the code for youimport java.util.Scanner; import java.u.pdf
Here is the code for youimport java.util.Scanner; import java.u.pdfHere is the code for youimport java.util.Scanner; import java.u.pdf
Here is the code for youimport java.util.Scanner; import java.u.pdf
 
Hello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfHello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdf
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
 
Modify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdfModify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdf
 
import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdf
 
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
 
import java.util.Scanner;public class HornersPolynomial {   .pdf
import java.util.Scanner;public class HornersPolynomial {   .pdfimport java.util.Scanner;public class HornersPolynomial {   .pdf
import java.util.Scanner;public class HornersPolynomial {   .pdf
 
Sharable_Java_Python.pdf
Sharable_Java_Python.pdfSharable_Java_Python.pdf
Sharable_Java_Python.pdf
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
 
Java Program- Wrtie a Fraction classGiven the main method of a dri.pdf
Java Program- Wrtie a Fraction classGiven the main method of a dri.pdfJava Program- Wrtie a Fraction classGiven the main method of a dri.pdf
Java Program- Wrtie a Fraction classGiven the main method of a dri.pdf
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...
 
Methods intro-1.0
Methods intro-1.0Methods intro-1.0
Methods intro-1.0
 

More from aone2010

(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf
(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf
(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdfaone2010
 
(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf
(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf
(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdfaone2010
 
(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf
(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf
(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdfaone2010
 
(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf
(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf
(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdfaone2010
 
(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf
(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf
(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdfaone2010
 
(Three types of business organizations) Which of the following stateme.pdf
(Three types of business organizations) Which of the following stateme.pdf(Three types of business organizations) Which of the following stateme.pdf
(Three types of business organizations) Which of the following stateme.pdfaone2010
 
(TF) According to the Central Limit Theorem- if x is normally distribu.pdf
(TF) According to the Central Limit Theorem- if x is normally distribu.pdf(TF) According to the Central Limit Theorem- if x is normally distribu.pdf
(TF) According to the Central Limit Theorem- if x is normally distribu.pdfaone2010
 
(Table) According to the table- the GDP deflator for 2012 is approxima.pdf
(Table) According to the table- the GDP deflator for 2012 is approxima.pdf(Table) According to the table- the GDP deflator for 2012 is approxima.pdf
(Table) According to the table- the GDP deflator for 2012 is approxima.pdfaone2010
 
(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf
(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf
(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdfaone2010
 
(Hint- use induction on the sequence of operations- check the proof of.pdf
(Hint- use induction on the sequence of operations- check the proof of.pdf(Hint- use induction on the sequence of operations- check the proof of.pdf
(Hint- use induction on the sequence of operations- check the proof of.pdfaone2010
 
(Explain)(1) cconomic equality is one of the most important characteri.pdf
(Explain)(1) cconomic equality is one of the most important characteri.pdf(Explain)(1) cconomic equality is one of the most important characteri.pdf
(Explain)(1) cconomic equality is one of the most important characteri.pdfaone2010
 
(Fill in the blank) Patterns are the behavior- derived from the relati.pdf
(Fill in the blank) Patterns are the behavior- derived from the relati.pdf(Fill in the blank) Patterns are the behavior- derived from the relati.pdf
(Fill in the blank) Patterns are the behavior- derived from the relati.pdfaone2010
 
(e) P(0-76z0-54) (f) P(z-3).pdf
(e) P(0-76z0-54) (f) P(z-3).pdf(e) P(0-76z0-54) (f) P(z-3).pdf
(e) P(0-76z0-54) (f) P(z-3).pdfaone2010
 
(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf
(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf
(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdfaone2010
 
(C++) Write a car rental application- Things that you need to impleme.pdf
(C++) Write a car rental application-  Things that you need to impleme.pdf(C++) Write a car rental application-  Things that you need to impleme.pdf
(C++) Write a car rental application- Things that you need to impleme.pdfaone2010
 
(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf
(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf
(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdfaone2010
 
(d) Click the icon to view the data table (Type an integer or a decima.pdf
(d) Click the icon to view the data table (Type an integer or a decima.pdf(d) Click the icon to view the data table (Type an integer or a decima.pdf
(d) Click the icon to view the data table (Type an integer or a decima.pdfaone2010
 
(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf
(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf
(c) Suppose events A and B partition a sample space S- where A and B h (1).pdfaone2010
 
(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf
(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf
(Preparing a balance sheet) Prepare a balance sheet from the informati.pdfaone2010
 
(PE12-7) Create a Windows application that has the functionality of.pdf
(PE12-7) Create a Windows application that has    the functionality of.pdf(PE12-7) Create a Windows application that has    the functionality of.pdf
(PE12-7) Create a Windows application that has the functionality of.pdfaone2010
 

More from aone2010 (20)

(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf
(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf
(TRUE or FALSE-) When interest expense is subtracted from EBIT- the re.pdf
 
(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf
(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf
(TRUE or FALSE-) Secondary markets are markets for securities that wer.pdf
 
(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf
(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf
(TRUE or FALSE-) Most securities sales on the New York Stock Exchange.pdf
 
(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf
(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf
(Trypanosomiasis)1- How to prevent the spread of the microorganisms (.pdf
 
(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf
(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf
(TRUE or FALSE-) Current assets are the assets that the firm uses to g.pdf
 
(Three types of business organizations) Which of the following stateme.pdf
(Three types of business organizations) Which of the following stateme.pdf(Three types of business organizations) Which of the following stateme.pdf
(Three types of business organizations) Which of the following stateme.pdf
 
(TF) According to the Central Limit Theorem- if x is normally distribu.pdf
(TF) According to the Central Limit Theorem- if x is normally distribu.pdf(TF) According to the Central Limit Theorem- if x is normally distribu.pdf
(TF) According to the Central Limit Theorem- if x is normally distribu.pdf
 
(Table) According to the table- the GDP deflator for 2012 is approxima.pdf
(Table) According to the table- the GDP deflator for 2012 is approxima.pdf(Table) According to the table- the GDP deflator for 2012 is approxima.pdf
(Table) According to the table- the GDP deflator for 2012 is approxima.pdf
 
(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf
(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf
(I) A randots dample of boemser (i- millinss of deliand paid by lurge.pdf
 
(Hint- use induction on the sequence of operations- check the proof of.pdf
(Hint- use induction on the sequence of operations- check the proof of.pdf(Hint- use induction on the sequence of operations- check the proof of.pdf
(Hint- use induction on the sequence of operations- check the proof of.pdf
 
(Explain)(1) cconomic equality is one of the most important characteri.pdf
(Explain)(1) cconomic equality is one of the most important characteri.pdf(Explain)(1) cconomic equality is one of the most important characteri.pdf
(Explain)(1) cconomic equality is one of the most important characteri.pdf
 
(Fill in the blank) Patterns are the behavior- derived from the relati.pdf
(Fill in the blank) Patterns are the behavior- derived from the relati.pdf(Fill in the blank) Patterns are the behavior- derived from the relati.pdf
(Fill in the blank) Patterns are the behavior- derived from the relati.pdf
 
(e) P(0-76z0-54) (f) P(z-3).pdf
(e) P(0-76z0-54) (f) P(z-3).pdf(e) P(0-76z0-54) (f) P(z-3).pdf
(e) P(0-76z0-54) (f) P(z-3).pdf
 
(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf
(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf
(c) The SOP form of a function is f(a-b-c)-m(0-1)- Give the POS of its.pdf
 
(C++) Write a car rental application- Things that you need to impleme.pdf
(C++) Write a car rental application-  Things that you need to impleme.pdf(C++) Write a car rental application-  Things that you need to impleme.pdf
(C++) Write a car rental application- Things that you need to impleme.pdf
 
(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf
(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf
(DuPont analysis)Triangular Chemicals has total assets of $ 97 million.pdf
 
(d) Click the icon to view the data table (Type an integer or a decima.pdf
(d) Click the icon to view the data table (Type an integer or a decima.pdf(d) Click the icon to view the data table (Type an integer or a decima.pdf
(d) Click the icon to view the data table (Type an integer or a decima.pdf
 
(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf
(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf
(c) Suppose events A and B partition a sample space S- where A and B h (1).pdf
 
(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf
(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf
(Preparing a balance sheet) Prepare a balance sheet from the informati.pdf
 
(PE12-7) Create a Windows application that has the functionality of.pdf
(PE12-7) Create a Windows application that has    the functionality of.pdf(PE12-7) Create a Windows application that has    the functionality of.pdf
(PE12-7) Create a Windows application that has the functionality of.pdf
 

Recently uploaded

Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 

Recently uploaded (20)

Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 

(I'm trying to make a menu that repeats unless you enter 4- How do I g.pdf

  • 1. (I'm trying to make a menu that repeats unless you enter 4. How do I get this to repeat the printMenu()Method that prints the options and keeps repeating options until you hit exit #4?) public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); printMenu(); int x = input.nextInt(); if ( x == 1) countPunctuation(); if ( x == 2) charactertoBinary(); if ( x == 3) binaryToCharacter(); if (x == 4) System.out.print("You have chosen Exit. Goodbye"); if (x > 4) System.out.print("Error"); printMenu(); if (x < 1) System.out.print("Error"); } // Create first Method. Print Menu*** public static void printMenu(){ String newline = System.getProperty("line.separator"); System.out.print("Enter '1' to count punctuation symbols in a String." + newline + "Enter '2' to convert characters to binary." + newline + "Enter '3' to convert 8-bit binary to a character." + newline + "Enter '4' to exit."+newline +"Enter option:"); }