Question

Create a program that allows the user to input a list of first names into one...

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 emial addresses where the address is of the following form: [email protected]


Declare FirstName[100] as String
Declare LastName[100] as String
Declare email as String
Declare K as Integer
Declare index as Integer


Write "Enter first and last name."
Write "Enter * to exit"

Input FirstName[index]
While FirstName != "*"
   If index >= OR FirstName[index]=="*"
   Write "Enter last name"
   Input LastName[index]
   Set email[index] to FirstName[index]+"."+LastName[index]+"@mycollege.edu"
   Set index to index + 1
   Write "Enter first name"
   Write "Enter * to exit"
   Input FirstName[index]
   End While
   Then loop = 1
   While loop >=index
   Output email[loop]
   Set loop to loop + 1
   End While
   End If
   End Then

Is this how I would write the pseudocode for this? Can someone make some tweaks or input. This is done in raptor also.

Homework Answers

Answer #1

Declare FirstName[100] as String
Declare LastName[100] as String
Declare emails[100] as String
Declare size as Integer
Declare index as Integer

While True
   Write "Enter first and last name."
   Write "Enter * to exit"
   Input FirstName[index]
   If FirstName=="*"
       Break
   End If
Input LastName[index]
Set emails[index] to FirstName[index]+"."+LastName[index]+"@mycollege.edu"
Set index to index + 1
   Set Size to Size + 1  
End While
For I 0 to Size
   Write Emails[I]
End FOr

Know the answer?
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
Similar Questions
11. First and Last Design a program that asks the user for a series of names...
11. First and Last Design a program that asks the user for a series of names (in no particular order). After the final person's name has been entered, the program should display the name that is first alphabetically and the name that is last alphabetically. For example, if the user enters the names Kristin, Joel, Adam, Beth, Zeb, and Chris, the program would display Adam and Zeb. I need help with creating a python code for this using a sentinel...
3. Create a program which allows the user to swap individual words in an input string....
3. Create a program which allows the user to swap individual words in an input string. Given a string of input, your program should count and store the number of words in a 2D array. The user can then select the index of the words they want to swap. Your program should swap those two words and then print the entire string to ouput. • Use string prompt "> ". • Use indices prompt "Enter two indices: ". • Remove...
(8 marks) Write a program to ask user to input an integer and display the special...
Write a program to ask user to input an integer and display the special pattern accordingly. REQUIREMENTS The user input is always correct (input verification is not required). Your code must use loop statements (for, while or do-while). Your program should use only the following 3 output statements, one of EACH of the followings: System.out.print("-"); // print # System.out.print("+"); // print + System.out.println(); // print a newline Your code must work exactly like the following example (the text in bold...
Write a program that allows the user to enter the last names of five candidates in...
Write a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate. The program should then output each candidate’s name, votes received by that candidate, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. A sample output is as follows: Candidate Johnson Miller Duffy Robinson Sam Votes Received 5000 4000 6000 2500 1800 19300...
DATA STRUCTURE /C++ Write a program that allows the user to enter the last names offive...
DATA STRUCTURE /C++ Write a program that allows the user to enter the last names offive candidates in a local election and the votes received by each candidate. The program should then output each candidate’s name, votes received by that candidate, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. A sample output is as follows: Candidate Johnson Miller Duffy Robinson Sam Total Votes Received 5000 4000 6000...
**please write code with function definition taking in input and use given variable names** for e.g....
**please write code with function definition taking in input and use given variable names** for e.g. List matchNames(List inputNames, List secRecords) Java or Python Please Note:    * The function is expected to return a STRING_ARRAY.      * The function accepts following parameters:      *  1. STRING_ARRAY inputNames      *  2. STRING_ARRAY secRecords      */ Problem Statement Introduction Imagine you are helping the Security Exchange Commission (SEC) respond to anonymous tips. One of the biggest problems the team faces is handling the transcription of the companies reported...
Write code in JAVA Write a program that will output a right triangle based on user...
Write code in JAVA Write a program that will output a right triangle based on user specified input height (int) and specified input symbol (char).The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches specified input height. Output a space after each user-specified character, including after the line's last user-specified character. Hint: Use a nested for loop. Ex:If the input...
Name the script for.sh.  This script will create a shopping list. Ask the user to enter items...
Name the script for.sh.  This script will create a shopping list. Ask the user to enter items separated by a space. Read the list. Use a for loop to write (use echo) the items to a file called shopping_list. You should use >> to append the output to the file, so each time the script is run the list should get longer. After the for loop finishes, display (use cat) the contents of the shopping list with 1 item per line....
Write a function in c using #include <stdio.h> that takes a one-dimensional integer array and returns...
Write a function in c using #include <stdio.h> that takes a one-dimensional integer array and returns the index of the first occurance of the smallest value in the array. Your function must be able to process all the elements in the array. Create a function prototype and function definition (after the main function). Your main function should declare a 100 element integer array. Prompt the user for the number of integers to enter and then prompt the user for each...
7.6 LAB: Exception handling to detect input String vs. Integer The given program reads a list...
7.6 LAB: Exception handling to detect input String vs. Integer The given program reads a list of single-word first names and ages (ending with -1), and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a String rather than an Integer. At FIXME in the code, add a try/catch statement to catch java.util.InputMismatchException, and output 0 for the age. Ex: If the input is: Lee 18 Lua...