SlideShare a Scribd company logo
Ask the user for a number between 1 and 11; stop asking when the user enters 0 OR when the
total goes over 21. Display the total on the screen. For example:
if input is over 12 display "Please follow directions!"
Solution
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author USER
*/
import java.util.*;
public class total
{
public static void main(String args[])
{
int tot=0,n;
System.out.println("Enter the Number Between 1 to 11:");
Scanner scan=new Scanner(System.in);
n=scan.nextInt();
for(int i=1;i<=n;i++)
{
tot=tot+n;
if(n==0||tot>21)
{
System.out.println("Total:"+tot);
System.out.println("Thank you for playing!!!");
System.exit(tot);
}
else
if(n==12)
{
System.out.println("Please follow directions!");
}
System.out.println("Enter the Number Between 1 to 11:");
n=scan.nextInt();
}
}
}

More Related Content

Similar to Ask the user for a number between 1 and 11; stop asking when the use.pdf

Base de-datos
Base de-datosBase de-datos
Base de-datos
ferney1428
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
David Voyles
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
Sunil OS
 
Algoritmos sujei
Algoritmos sujeiAlgoritmos sujei
Algoritmos sujei
gersonjack
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
Anonymous9etQKwW
 
Cis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.comCis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.com
Baileya126
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
ycpthalachira
 
java program assigment -1
java program assigment -1java program assigment -1
java program assigment -1
Ankit Gupta
 
CIS 115 Exceptional Education - snaptutorial.com
CIS 115   Exceptional Education - snaptutorial.comCIS 115   Exceptional Education - snaptutorial.com
CIS 115 Exceptional Education - snaptutorial.com
DavisMurphyB33
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
Baileyao
 
Cis 115 Education Organization -- snaptutorial.com
Cis 115   Education Organization -- snaptutorial.comCis 115   Education Organization -- snaptutorial.com
Cis 115 Education Organization -- snaptutorial.com
DavisMurphyB99
 
Ecs 10 programming assignment 4 loopapalooza
Ecs 10 programming assignment 4   loopapaloozaEcs 10 programming assignment 4   loopapalooza
Ecs 10 programming assignment 4 loopapalooza
JenniferBall44
 
First fare 2010 lab-view creating custom dashboards
First fare 2010 lab-view creating custom dashboardsFirst fare 2010 lab-view creating custom dashboards
First fare 2010 lab-view creating custom dashboardsOregon FIRST Robotics
 
Java file
Java fileJava file
Java file
simarsimmygrewal
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
KimVeeL
 
Activity 5
Activity 5Activity 5
Activity 5
Heidi Owens
 
Lab-11-C-Problems.pptx
Lab-11-C-Problems.pptxLab-11-C-Problems.pptx
Lab-11-C-Problems.pptx
ShimoFcis
 
Cis 115 Enhance teaching / snaptutorial.com
Cis 115  Enhance teaching / snaptutorial.comCis 115  Enhance teaching / snaptutorial.com
Cis 115 Enhance teaching / snaptutorial.com
HarrisGeorg51
 

Similar to Ask the user for a number between 1 and 11; stop asking when the use.pdf (20)

Foundations of Programming Part I
Foundations of Programming Part IFoundations of Programming Part I
Foundations of Programming Part I
 
Base de-datos
Base de-datosBase de-datos
Base de-datos
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
 
Algoritmos sujei
Algoritmos sujeiAlgoritmos sujei
Algoritmos sujei
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 
Cis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.comCis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.com
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
 
java program assigment -1
java program assigment -1java program assigment -1
java program assigment -1
 
CIS 115 Exceptional Education - snaptutorial.com
CIS 115   Exceptional Education - snaptutorial.comCIS 115   Exceptional Education - snaptutorial.com
CIS 115 Exceptional Education - snaptutorial.com
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
 
Cis 115 Education Organization -- snaptutorial.com
Cis 115   Education Organization -- snaptutorial.comCis 115   Education Organization -- snaptutorial.com
Cis 115 Education Organization -- snaptutorial.com
 
Ecs 10 programming assignment 4 loopapalooza
Ecs 10 programming assignment 4   loopapaloozaEcs 10 programming assignment 4   loopapalooza
Ecs 10 programming assignment 4 loopapalooza
 
First fare 2010 lab-view creating custom dashboards
First fare 2010 lab-view creating custom dashboardsFirst fare 2010 lab-view creating custom dashboards
First fare 2010 lab-view creating custom dashboards
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Activity 5
Activity 5Activity 5
Activity 5
 
Lab-11-C-Problems.pptx
Lab-11-C-Problems.pptxLab-11-C-Problems.pptx
Lab-11-C-Problems.pptx
 
Cis 115 Enhance teaching / snaptutorial.com
Cis 115  Enhance teaching / snaptutorial.comCis 115  Enhance teaching / snaptutorial.com
Cis 115 Enhance teaching / snaptutorial.com
 

More from sauravmanwanicp

Are hydrophobic interactions weak or strongSolutionHydrophobi.pdf
Are hydrophobic interactions weak or strongSolutionHydrophobi.pdfAre hydrophobic interactions weak or strongSolutionHydrophobi.pdf
Are hydrophobic interactions weak or strongSolutionHydrophobi.pdf
sauravmanwanicp
 
What is another word for account based forecast What is anothe.pdf
What is another word for account based forecast What is anothe.pdfWhat is another word for account based forecast What is anothe.pdf
What is another word for account based forecast What is anothe.pdf
sauravmanwanicp
 
What function can be used to return multiple numeric data such as in.pdf
What function can be used to return multiple numeric data such as in.pdfWhat function can be used to return multiple numeric data such as in.pdf
What function can be used to return multiple numeric data such as in.pdf
sauravmanwanicp
 
Answer the following questions in reference to Drosophila melanogast.pdf
Answer the following questions in reference to Drosophila melanogast.pdfAnswer the following questions in reference to Drosophila melanogast.pdf
Answer the following questions in reference to Drosophila melanogast.pdf
sauravmanwanicp
 
There are five feasible solutions to a three-objective optimization p.pdf
There are five feasible solutions to a three-objective optimization p.pdfThere are five feasible solutions to a three-objective optimization p.pdf
There are five feasible solutions to a three-objective optimization p.pdf
sauravmanwanicp
 
An air-filled parallel-plate capacitor has capacitance Co. If two ide.pdf
An air-filled parallel-plate capacitor has capacitance Co. If two ide.pdfAn air-filled parallel-plate capacitor has capacitance Co. If two ide.pdf
An air-filled parallel-plate capacitor has capacitance Co. If two ide.pdf
sauravmanwanicp
 
The incandescent lightbulb was actually invented by Humphry Davy in 1.pdf
The incandescent lightbulb was actually invented by Humphry Davy in 1.pdfThe incandescent lightbulb was actually invented by Humphry Davy in 1.pdf
The incandescent lightbulb was actually invented by Humphry Davy in 1.pdf
sauravmanwanicp
 
The fossil record provides little information about ancient mosses. D.pdf
The fossil record provides little information about ancient mosses. D.pdfThe fossil record provides little information about ancient mosses. D.pdf
The fossil record provides little information about ancient mosses. D.pdf
sauravmanwanicp
 
The DNA sequence below is a shortened version of the sequence on the .pdf
The DNA sequence below is a shortened version of the sequence on the .pdfThe DNA sequence below is a shortened version of the sequence on the .pdf
The DNA sequence below is a shortened version of the sequence on the .pdf
sauravmanwanicp
 
the conducting tissue found in vascular plants that functions in tra.pdf
the conducting tissue found in vascular plants that functions in tra.pdfthe conducting tissue found in vascular plants that functions in tra.pdf
the conducting tissue found in vascular plants that functions in tra.pdf
sauravmanwanicp
 
Show that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses Choose the ap.pdf
Show that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses  Choose the ap.pdfShow that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses  Choose the ap.pdf
Show that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses Choose the ap.pdf
sauravmanwanicp
 
Read the short article Horizontal Gene Transfer in E Coli and answer.pdf
Read the short article Horizontal Gene Transfer in E Coli and answer.pdfRead the short article Horizontal Gene Transfer in E Coli and answer.pdf
Read the short article Horizontal Gene Transfer in E Coli and answer.pdf
sauravmanwanicp
 
Please select the best answer and click submit. The owners of fou.pdf
Please select the best answer and click submit. The owners of fou.pdfPlease select the best answer and click submit. The owners of fou.pdf
Please select the best answer and click submit. The owners of fou.pdf
sauravmanwanicp
 
One function of the spliceosome is to (Select all that apply.)A. .pdf
One function of the spliceosome is to (Select all that apply.)A. .pdfOne function of the spliceosome is to (Select all that apply.)A. .pdf
One function of the spliceosome is to (Select all that apply.)A. .pdf
sauravmanwanicp
 
Match the following organelles with their key functions in the cell .pdf
Match the following organelles with their key functions in the cell  .pdfMatch the following organelles with their key functions in the cell  .pdf
Match the following organelles with their key functions in the cell .pdf
sauravmanwanicp
 
please choose the correct answerIn the ABO blood-type phenotype, w.pdf
please choose the correct answerIn the ABO blood-type phenotype, w.pdfplease choose the correct answerIn the ABO blood-type phenotype, w.pdf
please choose the correct answerIn the ABO blood-type phenotype, w.pdf
sauravmanwanicp
 
mo Press Submit until all questions are colored green and you have do.pdf
mo Press Submit until all questions are colored green and you have do.pdfmo Press Submit until all questions are colored green and you have do.pdf
mo Press Submit until all questions are colored green and you have do.pdf
sauravmanwanicp
 
matching chose the stage of the light reactions which the statement.pdf
matching chose the stage of the light reactions which the statement.pdfmatching chose the stage of the light reactions which the statement.pdf
matching chose the stage of the light reactions which the statement.pdf
sauravmanwanicp
 
Let E be the set of all even integers, and let O be the set of all o.pdf
Let E be the set of all even integers, and let O be the set of all o.pdfLet E be the set of all even integers, and let O be the set of all o.pdf
Let E be the set of all even integers, and let O be the set of all o.pdf
sauravmanwanicp
 
JavaIm not sure how to implement this code can someone help me .pdf
JavaIm not sure how to implement this code can someone help me .pdfJavaIm not sure how to implement this code can someone help me .pdf
JavaIm not sure how to implement this code can someone help me .pdf
sauravmanwanicp
 

More from sauravmanwanicp (20)

Are hydrophobic interactions weak or strongSolutionHydrophobi.pdf
Are hydrophobic interactions weak or strongSolutionHydrophobi.pdfAre hydrophobic interactions weak or strongSolutionHydrophobi.pdf
Are hydrophobic interactions weak or strongSolutionHydrophobi.pdf
 
What is another word for account based forecast What is anothe.pdf
What is another word for account based forecast What is anothe.pdfWhat is another word for account based forecast What is anothe.pdf
What is another word for account based forecast What is anothe.pdf
 
What function can be used to return multiple numeric data such as in.pdf
What function can be used to return multiple numeric data such as in.pdfWhat function can be used to return multiple numeric data such as in.pdf
What function can be used to return multiple numeric data such as in.pdf
 
Answer the following questions in reference to Drosophila melanogast.pdf
Answer the following questions in reference to Drosophila melanogast.pdfAnswer the following questions in reference to Drosophila melanogast.pdf
Answer the following questions in reference to Drosophila melanogast.pdf
 
There are five feasible solutions to a three-objective optimization p.pdf
There are five feasible solutions to a three-objective optimization p.pdfThere are five feasible solutions to a three-objective optimization p.pdf
There are five feasible solutions to a three-objective optimization p.pdf
 
An air-filled parallel-plate capacitor has capacitance Co. If two ide.pdf
An air-filled parallel-plate capacitor has capacitance Co. If two ide.pdfAn air-filled parallel-plate capacitor has capacitance Co. If two ide.pdf
An air-filled parallel-plate capacitor has capacitance Co. If two ide.pdf
 
The incandescent lightbulb was actually invented by Humphry Davy in 1.pdf
The incandescent lightbulb was actually invented by Humphry Davy in 1.pdfThe incandescent lightbulb was actually invented by Humphry Davy in 1.pdf
The incandescent lightbulb was actually invented by Humphry Davy in 1.pdf
 
The fossil record provides little information about ancient mosses. D.pdf
The fossil record provides little information about ancient mosses. D.pdfThe fossil record provides little information about ancient mosses. D.pdf
The fossil record provides little information about ancient mosses. D.pdf
 
The DNA sequence below is a shortened version of the sequence on the .pdf
The DNA sequence below is a shortened version of the sequence on the .pdfThe DNA sequence below is a shortened version of the sequence on the .pdf
The DNA sequence below is a shortened version of the sequence on the .pdf
 
the conducting tissue found in vascular plants that functions in tra.pdf
the conducting tissue found in vascular plants that functions in tra.pdfthe conducting tissue found in vascular plants that functions in tra.pdf
the conducting tissue found in vascular plants that functions in tra.pdf
 
Show that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses Choose the ap.pdf
Show that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses  Choose the ap.pdfShow that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses  Choose the ap.pdf
Show that f(x)=57^x+1 and f^-1(x)=7x-75 are inverses Choose the ap.pdf
 
Read the short article Horizontal Gene Transfer in E Coli and answer.pdf
Read the short article Horizontal Gene Transfer in E Coli and answer.pdfRead the short article Horizontal Gene Transfer in E Coli and answer.pdf
Read the short article Horizontal Gene Transfer in E Coli and answer.pdf
 
Please select the best answer and click submit. The owners of fou.pdf
Please select the best answer and click submit. The owners of fou.pdfPlease select the best answer and click submit. The owners of fou.pdf
Please select the best answer and click submit. The owners of fou.pdf
 
One function of the spliceosome is to (Select all that apply.)A. .pdf
One function of the spliceosome is to (Select all that apply.)A. .pdfOne function of the spliceosome is to (Select all that apply.)A. .pdf
One function of the spliceosome is to (Select all that apply.)A. .pdf
 
Match the following organelles with their key functions in the cell .pdf
Match the following organelles with their key functions in the cell  .pdfMatch the following organelles with their key functions in the cell  .pdf
Match the following organelles with their key functions in the cell .pdf
 
please choose the correct answerIn the ABO blood-type phenotype, w.pdf
please choose the correct answerIn the ABO blood-type phenotype, w.pdfplease choose the correct answerIn the ABO blood-type phenotype, w.pdf
please choose the correct answerIn the ABO blood-type phenotype, w.pdf
 
mo Press Submit until all questions are colored green and you have do.pdf
mo Press Submit until all questions are colored green and you have do.pdfmo Press Submit until all questions are colored green and you have do.pdf
mo Press Submit until all questions are colored green and you have do.pdf
 
matching chose the stage of the light reactions which the statement.pdf
matching chose the stage of the light reactions which the statement.pdfmatching chose the stage of the light reactions which the statement.pdf
matching chose the stage of the light reactions which the statement.pdf
 
Let E be the set of all even integers, and let O be the set of all o.pdf
Let E be the set of all even integers, and let O be the set of all o.pdfLet E be the set of all even integers, and let O be the set of all o.pdf
Let E be the set of all even integers, and let O be the set of all o.pdf
 
JavaIm not sure how to implement this code can someone help me .pdf
JavaIm not sure how to implement this code can someone help me .pdfJavaIm not sure how to implement this code can someone help me .pdf
JavaIm not sure how to implement this code can someone help me .pdf
 

Recently uploaded

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 

Ask the user for a number between 1 and 11; stop asking when the use.pdf

  • 1. Ask the user for a number between 1 and 11; stop asking when the user enters 0 OR when the total goes over 21. Display the total on the screen. For example: if input is over 12 display "Please follow directions!" Solution /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author USER */ import java.util.*; public class total { public static void main(String args[]) { int tot=0,n; System.out.println("Enter the Number Between 1 to 11:"); Scanner scan=new Scanner(System.in); n=scan.nextInt(); for(int i=1;i<=n;i++) { tot=tot+n; if(n==0||tot>21) { System.out.println("Total:"+tot); System.out.println("Thank you for playing!!!");