Question

In: Computer Science

Please I can get a flowchart and a pseudocode for this java code. Thank you //import...

Please I can get a flowchart and a pseudocode for this java code. Thank you

//import the required classes
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class BirthdayReminder {
  
   public static void main(String[] args) throws IOException {
       // declare the required variables
String sName = null;
String names[] = new String[10];
String birthDates[] = new String[10];
int count = 0;
boolean flag = false;
// to read values from the console
BufferedReader dataIn = new BufferedReader(new InputStreamReader(
System.in));
// loop till the user enters 10 names or user enters ZZZ
for (int i = 0; i < 10; i++)
{
// prompt the user to enter the name
System.out.print("Enter person's name: ");
sName = dataIn.readLine();
// check the condition whether the user enters ZZZ if so break the loop
if (sName.equalsIgnoreCase("ZZZ"))
break;
// else assign the value to the names array
names[i] = sName;
// prompt the user to enter the date of birth
System.out.print("Enter Date of Birth as(mm/dd/yyyy): ");
birthDates[i] = dataIn.readLine();
count = count + 1;
}
// print the count value
System.out.println("The count of names is:" + count);
// print the list of names
System.out.println("The list of names:");
for (int i = 0; i < count; i++)
{
System.out.println(names[i]);
}
// loop till the user enters ZZZ
do
{
// prompt the user to enter the name
System.out.println("Enter a name: ");
sName = dataIn.readLine();
// check the condition for the user entered ZZZ if so break the loop
if (sName.equalsIgnoreCase("ZZZ"))
break;
// else search the name and display the respective date of birth
for (int i = 0; i < count; i++)
{
if (sName.equalsIgnoreCase(names[i]))
{
System.out.println(sName + "'s birthday is on "
+ birthDates[i]);
flag = true;
break;
}
}
// if the flag value is false then display the error message
if (flag == false)
System.out.println("The persons name is not in the list");
} while (true);
}
}

Solutions

Expert Solution

as you have mentioned you needed a flowchart in the question

please follow the link for the flow chart

thank you.


Related Solutions

Please can I get a flowchart and pseudocode for this java code. Thank you. TestScore.java import...
Please can I get a flowchart and pseudocode for this java code. Thank you. TestScore.java import java.util.Scanner; ;//import Scanner to take input from user public class TestScore {    @SuppressWarnings("resource")    public static void main(String[] args) throws ScoreException {//main method may throw Score exception        int [] arr = new int [5]; //creating an integer array for student id        arr[0] = 20025; //assigning id for each student        arr[1] = 20026;        arr[2] = 20027;...
Please can I kindly get a flowchart for this java code. Thank you. //import the required...
Please can I kindly get a flowchart for this java code. Thank you. //import the required classes import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BirthdayReminder {       public static void main(String[] args) throws IOException {        // declare the required variables String sName = null; String names[] = new String[10]; String birthDates[] = new String[10]; int count = 0; boolean flag = false; // to read values from the console BufferedReader dataIn = new BufferedReader(new InputStreamReader( System.in));...
Question: Can I get the code in Java for this assignment to compare? Please and thank you....
Question: Can I get the code in Java for this assignment to compare? Please and thank you. Can I get the code in Java for this assignment to compare? Please and thank you. Description Write a Java program to read data from a text file (file name given on command line), process the text file by performing the following: Print the total number of words in the file. Print the total number of unique words (case sensitive) in the file. Print...
Can you please rewrite this Java code so it can be better understood. import java.util.HashMap; import...
Can you please rewrite this Java code so it can be better understood. import java.util.HashMap; import java.util.Scanner; import java.util.Map.Entry; public class Shopping_cart {       static Scanner s= new Scanner (System.in);    //   declare hashmap in which key is dates as per mentioned and Values class as value which consists all the record of cases    static HashMap<String,Item> map= new HashMap<>();    public static void main(String[] args) {        // TODO Auto-generated method stub        getupdates();    }...
Please enter flowchart. Thank you! from tkinter import * from tkinter.scrolledtext import ScrolledText #method to open...
Please enter flowchart. Thank you! from tkinter import * from tkinter.scrolledtext import ScrolledText #method to open file and load contents into text field def open_file(): #fetching file name from filenamevar StringVar filename=filenamevar.get() try: #opening file in read mode file=open(filename,'r') #reading text text=file.read() #replacing current text in textField to read text textField.replace("1.0",END,text) #closing file file.close() except: #displaying error message in textField textField.replace("1.0", END, 'File not found!') #method to save current contents of file into file mentioned in file name entry field...
How would I prepare pseudocode and a flowchart for this? import java.util.Scanner; public class HotDogsBuns {...
How would I prepare pseudocode and a flowchart for this? import java.util.Scanner; public class HotDogsBuns {    private static int HOTDOG_COUNT_PKG = 10;    private static int BUNS_COUNT_PKG = 8;       public static void main(String[] args) {        //Scanner object to get user input        Scanner keyboard = new Scanner(System.in);               // Get number of people        System.out.print("How many people will be competing in the contest?: ");        int noOfPeople = keyboard.nextInt();...
Can you please add comments to this code? JAVA Code: import java.util.ArrayList; public class Catalog {...
Can you please add comments to this code? JAVA Code: import java.util.ArrayList; public class Catalog { String catalog_name; ArrayList<Item> list; Catalog(String cs_Gift_Catalog) { list=new ArrayList<>(); catalog_name=cs_Gift_Catalog; } String getName() { int size() { return list.size(); } Item get(int i) { return list.get(i); } void add(Item item) { list.add(item); } } Thanks!
Can someone please convert this java code to C code? import java.util.LinkedList; import java.util.List; public class...
Can someone please convert this java code to C code? import java.util.LinkedList; import java.util.List; public class Phase1 { /* Translates the MAL instruction to 1-3 TAL instructions * and returns the TAL instructions in a list * * mals: input program as a list of Instruction objects * * returns a list of TAL instructions (should be same size or longer than input list) */ public static List<Instruction> temp = new LinkedList<>(); public static List<Instruction> mal_to_tal(List<Instruction> mals) { for (int...
In this Java lab, you use the flowchart and pseudocode found in the figure below to...
In this Java lab, you use the flowchart and pseudocode found in the figure below to add code to a partially created Java program. When completed, college admissions officers should be able to use the Java program to determine whether to accept or reject a student, based on his or her test score and class rank. Declare the variables testScoreString and classRankString. Write the interactive input statements to retrieve: A student’s test score (testScoreString) A student's class rank (classRankString) Write...
I need the Java Code and Flowchart for the following program: Suppose you are given a...
I need the Java Code and Flowchart for the following program: Suppose you are given a 6-by-6 matrix filled with 0s and 1s. All rows and all columns have an even number of 1s. Let the user flip one cell (i.e., flip from 1 to 0 or from 0 to 1) and write a program to find which cell was flipped. Your program should prompt the user to enter a 6-by-6 array with 0s and 1s and find the first...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT