This program needs to be in pseudocode not JAVA C++ OR PYTHON I need a program t
ID: 3539092 • Letter: T
Question
This program needs to be in pseudocode not JAVA C++ OR PYTHON
I need a program that will sort names search for names and search for phone numbers for 20 names
The program should utilize modules and or functions should include a message module that explains to the user the purpose of the program. An input module that loads the names into array. A sorting module or function that puts names into aiphabetical order. A module that searches for a partical name. Use parallel arrays to input name and phone number sort both array to do a number look up. Use the binary seary to locate the phone number Include funtionality to sore the aray data in a file before exiting the program.
Modify user input functionality to permit the user to determine how many names will be input ( partially filled array Include search functionality permits a partial values to be enter
Explanation / Answer
import java.io.*;
class Q6
{
public static void main(String args[])throws IOException
{
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(read);
String name[]=new String[20];
String no[]=new String[20];
int i;
for(i=0;i<20;i++)
{
System.out.println("Enter the name with first letter capital");
name[i]=in.readLine();
System.out.println("Enter his Number");
no[i]=in.readLine();
}
String st=" ";char c;int j;
for(j='A';j<='Z';j++)
{
for(i=0;i<20;i++)
{
st=name[i];
c=st.charAt(0);
if((c==(char)j))
System.out.println(name[i]+" "+no[i]);
}
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.