Question

In: Computer Science

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));
// 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

Answer-

Flowchart for the following Java code-

=======================Flow Chart===================

There are four classes in this Flowchart-

  • function
  • procedures(main class)
  • constructor
  • destructor

There are three images you need to combine all images.

Note- Please do upvote, if any problem then comment in box sure I will help.


Related Solutions

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...
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;...
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();    }...
I need a java flowchart diagram for the following code: import java.util.*; public class Main {...
I need a java flowchart diagram for the following code: import java.util.*; public class Main {    public static void main(String[] args) {    Scanner sc=new Scanner(System.in);           System.out.print("Enter the input size: ");        int n=sc.nextInt();        int arr[]=new int[n];        System.out.print("Enter the sequence: ");        for(int i=0;i<n;i++)        arr[i]=sc.nextInt();        if(isConsecutiveFour(arr))        {        System.out.print("yes the array contain consecutive number:");        for(int i=0;i<n;i++)        System.out.print(arr[i]+" ");   ...
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...
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...
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...
please right make it so that it can run on jGRASP and java code please thank...
please right make it so that it can run on jGRASP and java code please thank you Debug Problem 1: As an intern for NASA, you have been instructed to debug a java program that calculates the speed that sound travels in water. Details about the formulas and correct results appear in the comments area at the top of the program Here is the code to debug: importjava.util.Scanner; /**    This program demonstrates a solution to the    The Speed of Sound...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT