Question about Homework

Open Question

Guessing a number

/* Project */
import java.io.*;
import java.util.*;
import java.lang.*;

public class Project{// start of class
public static void main (String [] args)throws Exception {//start of main method


BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
//Declaration part
int choice,done=0;
//end of declaration
do{
//Welcome start
System.out.print("*************************************\n");
System.out.print("* Welcome *\n");
System.out.print("* to *\n");
System.out.print("* Bull's Eye!! *\n");
System.out.print("*************************************\n\n\n");
//Choice selection area
System.out.print("Let's start the Game\n");
System.out.print("[1] Start the Game\n");
System.out.print("[2] About the Author\n");
System.out.print("[3] Exit\n");
System.out.print("Please enter your choice : ");
choice = Integer.parseInt(input.readLine());
// switch case
switch (choice)
{//start of switch
case 1:
Start();
break;

case 2:
Author();
break;
case 3:
System.exit(0);
break;
default:
System.out.print("Invalid Input");
}//end of switch
} while (done != 3);
}//end of main method
public static void Start()throws Exception{//start of function public start
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
//Declaration part
int num[],result=0,result1=0;
int ctr = 0;
num = new int[5];
String sequance = " ";
int[] random = new int[(int)Math.round(Math.random()* 9)];
//end of declaration
for (int x = 0; x < 5; x++){//random 5 number's
random[x] = (int)Math.round(Math.random() * 9);
System.out.println(random[x]);
}//end of random

do{//looping for 3 time's 5 guesses number
if (ctr == 0)
sequance = "First";
else if (ctr == 1)
sequance = "Second";
else if (ctr == 2)
sequance = "Third";

System.out.println("\n" + sequance+" trial, please Guess 5 number's range from 0-9 \n");
for (int x = 0; x < 5; x++){//Input for 5 number's supply by user
num[x] = Integer.parseInt(input.readLine());
}//end of input
System.out.println("\nList of your " + sequance + " guess 5 lucky number\n");
for (int y=0; y<5;y++){//looping for displaying 5 guesses number
System.out.print(num[y] + ", ");
}
System.out.print("\n\nResult of your lucky 5 number's \n\n");

for (int y = 0; y < 5; y++) {//comparing random and input number's
if (random[y] == num[y]){
System.out.print(num[y]+" ");
result = result + 1;
}

else if (random[y] != num[y]){
System.out.print(" x ");
result1 = result1 + 1;
}
}//end comparing random and input number's

System.out.print("\n\nNumber of correct guesses >> " + result + "\n");

System.out.print("\nNumber of incorrect guesses >> " + result1 + "\n\n\n");

if (result == 5){
System.out.print("\n Congratulation you made a Bull's Eye!!!!");
System.exit(0);
}
result = result - result;
result1 = result1 - result1;


ctr++;

}while(ctr<3);


}// end of function public start

public static void Author()throws Exception{//start of function author
char condition;
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.print("\n\n\n************************************************");
System.out.print("\n\n\n About the Author\n");

System.out.print("\nName : Rhey Jay A. Maddela\n");
System.out.print("Age : 24\n");
System.out.print("Status : Single\n");
System.out.print("Hobbie : Dota Adik XD\n");
System.out.print("Course : Diploma in Information Technology\n");
System.out.print("Subject: Introduction to Java\n");
System.out.print("Professor : Jay-Arr\n");
System.out.print("Date Created : February 04, 2009\n");
System.out.print("\n\n************************************************");
System.out.print("\n\nWould you like to go back in main menu? Press [Y] Yes | [N] No >> ");
condition = (char)System.in.read();
System.in.read(); System.in.read();
if (condition == 'y')
System.out.print("\n\n ^^ Going back to Main ^^\n\n");
else
{
System.out.print("\n\nProgram Terminated \n\n");
System.exit(0);
}
}//end of function author
}//end of class

this is one of the example of guessing a number can you please send another sample of this problem because this is from my classmate.

Posted by on

  • Anonymous Mar 04, 2009

    Can someone test this program code.. it seems like wrong. ^_^

×

Ad

3 Suggested Answers

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

SOURCE: I WANT THE WHOLE CODE FOR THIS

This whole code for above we can not give.

Posted on Aug 07, 2009

Ad
  • 87 Answers

SOURCE: What is important about word choice and language when communicating with culturally diverse people? Give examples or reasons for your answer.

Definition of many words have changed over last 100 years, Webster Dictionary (used world wide since late 1800'S) has defined many terms, words, and phrases in a way that has been widely adapted in many nationalities, and popularized in to what we know today as real world speech. Modern day generation, (born 80s to 2017) have introduced a stylish way of redefining uses and meanings of everyday words. Slang pronunciation pertaining to a certain crowd, gang, group, clan, clik, sect, nationality, etc. have also achieved their personal meaning in speech dialect, All is American Slang, criminal slang, back slang, rhyming slang, and other types of slang. Purposefull strong directive words used singularly or/and spoken combined in a certain order/phrase and/or certain tone of voice, mentioned and misused around and within the Not Agreeable crowd will cercaintly have a negative backfire. When just in America in ethnic dominate and divers neighbor hoods, American street English is common and in most areas a need to know language to communicate with the crowd. Street credit/smarts/speech defines personalities judged by the intermediate popular side of general public, and self esteem and confidence are affected by general judgmental society.

Your question is
Importance in word choice/language/dialect/speech/slang directed in converse towards culturally diverse (nationality) populations/groups/types(',goth,jock,skool kid,college,modern teen, hippie,) mexican/Hispanic/Chicano, North-south American, Canadian, russian, asian, American/Black, Native, Pacific islander, Hawaii, ect..

Answers Not Limited to
effort intention of (to) attempt:, to keep a certain level of peace, respect, integrity, reflective society standards, sincere moral gratification, sincere Community awarness, mission for relative public conversations.......ect...

Posted on Mar 26, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

What is the difference between Cuba and the United states of American social and economic structures of these two countries?


https://www.cia.gov/library/publications/the-world-factbook/geos/xx.html
You can review what this book says about the respective countries. Each country will be described in detail in areas of your enquiry.

Apr 07, 2017 | Homework

1 Answer

What is important about word choice and language when communicating with culturally diverse people? Give examples or reasons for your answer.


Definition of many words have changed over last 100 years, Webster Dictionary (used world wide since late 1800'S) has defined many terms, words, and phrases in a way that has been widely adapted in many nationalities, and popularized in to what we know today as real world speech. Modern day generation, (born 80s to 2017) have introduced a stylish way of redefining uses and meanings of everyday words. Slang pronunciation pertaining to a certain crowd, gang, group, clan, clik, sect, nationality, etc. have also achieved their personal meaning in speech dialect, All is American Slang, criminal slang, back slang, rhyming slang, and other types of slang. Purposefull strong directive words used singularly or/and spoken combined in a certain order/phrase and/or certain tone of voice, mentioned and misused around and within the Not Agreeable crowd will cercaintly have a negative backfire. When just in America in ethnic dominate and divers neighbor hoods, American street English is common and in most areas a need to know language to communicate with the crowd. Street credit/smarts/speech defines personalities judged by the intermediate popular side of general public, and self esteem and confidence are affected by general judgmental society.

Your question is
Importance in word choice/language/dialect/speech/slang directed in converse towards culturally diverse (nationality) populations/groups/types(',goth,jock,skool kid,college,modern teen, hippie,) mexican/Hispanic/Chicano, North-south American, Canadian, russian, asian, American/Black, Native, Pacific islander, Hawaii, ect..

Answers Not Limited to
effort intention of (to) attempt:, to keep a certain level of peace, respect, integrity, reflective society standards, sincere moral gratification, sincere Community awarness, mission for relative public conversations.......ect...

Mar 26, 2017 | Homework

1 Answer

What are the pros and cons of a Donald Trump presidency?


I don't think I have enough time to list them all and it all depends on where you are on the social-economic ladder.

Pros - infrastructure spending
- lower incomes taxes
- deleting estate taxes
- rich end up much better off
Cons - lower income taxes - deleting estate taxes - less money for redistribution - welfare, old age, those less fortunate
- poor end up with less support services
- less public education
- less regulation of pollution, markets, banks, etc

That is just a start.

Trying Googling Trump Executive Orders and you can see who the winners and looser are. Each one has winners and loosers. For example, privatizing all education will be a great benefit to the rich, who already send their children to private schools and don't want to pay for public education of those that can't afford private education. This would hurt probably all those that can't afford private education, because they will have to pay for some sort of private education, whether they can afford it or not.

Good luck,

Paul

Jan 04, 2017 | Homework

1 Answer

Why might insurance companies want to know your genotype?


1) Identification (can you imagine how difficult identification may be after an air crash)
2) At some point, doctors will be able to associate certain health risks with particular genes. Insurance companies likely will try to adjust premiums based upon the "risk" they might have to pay for particular treatments. While indivdidual predictions are highly speculative, the insurance industry depends upon population statistics. Those describe the number of people that have the questionalble genes subsequently have a disorder that they are associated with. These are my two "guesses."

Jan 04, 2017 | Homework

1 Answer

Do you think you should have a better future than your parents?


Yes if we work hard than our parents then we have a better future than our parents. More you work hard more you'll be succeed. You just have to focus on your aim and by full hardships you can live in a better way than your parents.

Jan 04, 2017 | Homework

1 Answer

What is the incubation period of breast cancer?


Incubation period is simply defined as a period that falls between the time of exposure to an infection to the time when the first symptoms and signs start showing up. For instance, if I were infected by the cold virus on day 1, and the symptoms start surfacing on day 4, that means the incubation period is 2 days. For some conditions, this very period may be as short as a few minutes, but for some, it may extend up to even 30 years!

Jan 04, 2017 | Homework

1 Answer

Is a 2.6 gpa bad?


If you want to no more calling of bad names by other students then you have to increase your gpa. At least your gpa should be more than 3 if it is out of 4. It's will be good for your future.

Jan 04, 2017 | Homework

Not finding what you are looking for?
Homework Logo

Related Topics:

71 people viewed this question

Ask a Question

Usually answered in minutes!

Top Homework Experts

Bilral

Level 1 Expert

29 Answers

aucklander

Level 1 Expert

8 Answers

Brad Brown

Level 3 Expert

16174 Answers

Are you a Homework Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...