Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, please read the instrcutions and please look out the sample output to see how the porgram should be. This is a beginner Java class

Hello, please read the instrcutions and please look out the sample output to see how the porgram should be. This is a beginner Java class so my knowledge is limited. For loops, if statements, parameters, nested loops, Scanner, return, etc. So please nothing too complex. I have also included a shell to use. image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

-------------------------------------------------------------------------------------

SHELL:

// Header information goes here import java.util.Scanner; public class BirthdayShell { /*create a Scanner object Call the method description ask the user how many times to repeat this program create a loop call the method play*/ public static void main(String[] args ) { } /*Since this method calls all the other methods, it must be implemented last. This method asks the user's name followed by asking five questions . To ask each question you must call the method askedQuestion by passing two parameters to it, this method will return an integer value that you will be adding it to the variable called birthday. At the end output the variable birthday and messages similar to the provided output. */ public static void play(Scanner kb) { int birthday = 0; } /*The input parameter is the given set, and a Scanner object This method outputs the set on the screen and ask the user if the birthday is in the given set, if it is this method returns the first number in the set otherwise it will return zero. remember that each set is stored as a String, to get the first number in the set, you must get the first token in the set and convert it to Integer. for example if String s = "19" then we can convert this string to an Integer with the following code int a = Integer.parseInt(s) */ public static int askQuestion(String set, Scanner kb ) { return 0; } /*this method creates a String representing the set 1 and returns the string that was cretaed look at the sample output to cretae the string. It must be exactly like the provided output*/ public static String set1() { return ""; } /*This method cretaes the set 2*/ public static String set2() { return ""; } /*This method cretaes the set 3*/ public static String set3() { return ""; } /*This method cretaes the set 4*/ public static String set4() { return ""; } /*this method cretaes the set 5*/ public static String set5() { return ""; } /*this method outputs the description of this program*/ public static void description() { } } 
Problem: Guessing birthday You can find out your friend's birthday by asking 5 questions. You program should provide 5 different sets of numbers. Then your program should ask the user if her his birthday appears in any of the given sets. Five different sets have been provided below For example, if your friend's birthday is on the 19th,then the value 19th is in the set 1, set 3 and set 5. Your friend's birthday will be the sum of the first number that appears in the sets 1, 3, and 5. Therefore, your friend's bithday is 1 +2+ 16-19 A Java file has been provided for you. For each method a description has been provided. You need to fill in the code for each method. Here are the sets of the numbers that you must use in your program: Set 1-, 3, 5,7,9, 11, 13, 15, 17, 19, 21, 23, 25, 27,29,31) Set 2 (2, 3, 6,7, 10, 11, 14, 15, 18, 19, 22, 23, 26,27, 30, 31) Set 3 -(4, 5, 6,7,12, 13, 14, 15, 20, 21, 22, 23, 28, 29,30, 31) Set 4 - (8,9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29,30, 31) Set 5 (16, 17, 18, 19,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) Sample output: Welcome to Birthday Guessing webaite by your name You will be prompted to answer five questions Then computer wil1 guess your birthday How many times do you to use this software? 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Learn how volunteers differ from nonvolunteers

Answered: 1 week ago