Question

USING RAPTOR For the following Programming Challenges, use the modular approach and pseudocode to design a suitable program to solve it. Create a program that allows the user to input a list of first...

USING RAPTOR

For the following Programming Challenges, use the modular approach and pseudocode to design a suitable program to solve it.
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The output should be a list of email addresses where the address is of the following from: [email protected]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class EmailGenerator {

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       List<String> firstName = new ArrayList<String>();
       List<String> lastName = new ArrayList<String>();
       Scanner scan = new Scanner(System.in);
       System.out.println("TO TERMINATE INPUT ENTER 999999");
       int count = 0;
       do {

           System.out.print("Enter First Name: ");

           String fn = scan.next();
           if (!fn.equalsIgnoreCase("999999"))
               firstName.add(fn);
           else
               break;
           System.out.print("Enter Last Name: ");
           String ln = scan.next();
           // Check to terminate input
           if (!ln.equalsIgnoreCase("999999"))
               lastName.add(ln);
           else
               break;
           count ++;

       } while (true);

       for(int i=0;i<count;i++)
           System.out.println("Email : " + firstName.get(i) +"." + lastName.get(i) +"@mycollege.edu");
   }

}

Add a comment
Know the answer?
Add Answer to:
USING RAPTOR For the following Programming Challenges, use the modular approach and pseudocode to design a suitable program to solve it. Create a program that allows the user to input a list of first...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using the Raptor Program and knowledge of algorithm development, create a program that inputs a list...

    Using the Raptor Program and knowledge of algorithm development, create a program that inputs a list of employee names and salaries stored in parallel arrays. The salaries should be floating point numbers in increments of 100. For example, a salary of $36,000 should be input as 36.0 and a salary of $85,900 should be input as 85.9. Find the mean (average) salary and display the names and salaries of employees who earn within a range of $5,000 from the mean....

  • Use your knowledge of algorithm development to create a program using RAPTOR to solve the problem...

    Use your knowledge of algorithm development to create a program using RAPTOR to solve the problem below. Input a list of student names (in to array student[]) and testing scores stored in parallel arrays. Each student have 3 testing scores ranging from 0 to 100 (store into parallel array score1[], score2[], score3[]). Output average score for each student and print out what is his final grade. If average score <60, got F grade. If 60<=average score<70, got D grade. If...

  • Write a C++ console application that allows your user to capture rainfall statistics. Your program should...

    Write a C++ console application that allows your user to capture rainfall statistics. Your program should contain an array of 12 doubles for the rainfall values as well as a parallel array containing the names of the months. Using each of the month names, prompt your user for the total rainfall for that month. The program should validate user input by guarding against rainfall values that are less than zero. After all 12 entries have been made, the program should...

  • PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do...

    PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do one of five things at a time: 1. Add students to database. • There should be no duplicate students. If student already exists, do not add the data again; print a message informing student already exists in database. • Enter name, age, and address. 2. Search for students in the database by name. • User enters student name to search • Show student name,...

  • Your mission in this programming assignment is to create a Python program that will take an...

    Your mission in this programming assignment is to create a Python program that will take an input file, determine if the contents of the file contain email addresses and/or phone numbers, create an output file with any found email addresses and phone numbers, and then create an archive with the output file as its contents.   Tasks Your program is to accomplish the following: ‐ Welcome the user to the program ‐ Prompt for and get an input filename, a .txt...

  • C++ There are to be two console inputs to the program, as explained below. For each input, there is to be a default val...

    C++ There are to be two console inputs to the program, as explained below. For each input, there is to be a default value, so that the user can simply press ENTER to accept any default. (That means that string will be the best choice of data type for the console input for each option.) The two console inputs are the names of the input and output files. The default filenames are to be fileContainingEmails.txt for the input file, and...

  • NOTE:- NO "BREAK" COMMAND PLEASE This program allows the user to create a grocery list, which...

    NOTE:- NO "BREAK" COMMAND PLEASE This program allows the user to create a grocery list, which will give them a breakdown of each item they want to buy, including the amount that should be purchased. The program must use two separate lists to accomplish this! The user can continue entering items indefinitely, stopping only when theyenter the sentinel value “END”. After entering each item, they should be asked how many of that item they want to buy. After their list...

  • Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your...

    Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your pseudocode and C-program, use only what you have learned in this class so far. (Menu) Design a menu for question 2 and 3. So far, you use one program to solve all lab questions. But some of you may feel awkward when you want to demo/test only one lab question. To overcome that, your program should show a menu so that the users of...

  • Please use pseudocode for this response, any additional advice for making this as easy to understand...

    Please use pseudocode for this response, any additional advice for making this as easy to understand as possible is greatly appreciated. Problem Statement Assume the Scores array is parallel to the Players array (both arrays are below). Scores array Scores[0] = 198 Scores[1] = 486 Scores[2] = 651 Scores[3] = 185 Scores[4] = 216 Scores[5] = 912 Scores[6] = 173 Scores[7] = 319 Scores[8] = 846 Scores[9] = 989 Players Array Players[0] = "Joe" Players[1] = "Ann" Players[2] = "Marty"...

  • Write a program that will first receive as input the name of an input file and an output file. It will then read in a list of names, id #s, and balances from the input file specified (call it InFile.t...

    Write a program that will first receive as input the name of an input file and an output file. It will then read in a list of names, id #s, and balances from the input file specified (call it InFile.txt) which you will create from the data provided below. The program will then prompt the user for a name to search for, when it finds the name it will output to a file (call it OFile.txt) the person’s id#, name,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT