219k views
9 votes
Create a flowchart that assigns a counselor to a student.

You need to ask a student for the first letter of his/her last name. Assign a counselor based on the following criteria:
A through M are assigned to Ms. Jones
N through Z are assigned to Mr. Sanchez

User Juris
by
7.0k points

2 Answers

9 votes

Final answer:

To assign a counselor to a student via flowchart, collect the first letter of the student's last name, use a decision box to direct A-M to Ms. Jones and N-Z to Mr. Sanchez, and clearly mark the process from start to end.

Step-by-step explanation:

To create a flowchart that assigns a counselor to a student based on the first letter of their last name, you can proceed with the following steps:

Start with a 'Start' symbol, a circle or oval that indicates where the flowchart begins.

Next, add a process box that states 'Ask for the first letter of the student's last name.'

Following that, use a decision diamond to ask a question that separates the names: 'Is the first letter A-M?' If the answer is yes, draw an arrow to a process box that assigns 'Ms. Jones' as the counselor. If no, the arrow should lead to a process box assigning 'Mr. Sanchez' as the counselor.

Finally, end with an 'End' symbol, a circle or oval indicating where the process concludes.

Remember to use clear labeling, arrows for direction, and appropriate symbols to ensure the flowchart is easy to follow.

User AdrianBR
by
6.2k points
8 votes
Please Help! Unit 6: Lesson 1 - Coding Activity 2
Instructions: Hemachandra numbers (more commonly known as Fibonacci numbers) are found by starting with two numbers then finding the next number by adding the previous two numbers together. The most common starting numbers are 0 and 1 giving the numbers 0, 1, 1, 2, 3, 5...
The main method from this class contains code which is intended to fill an array of length 10 with these Hemachandra numbers, then print the value of the number in the array at the index entered by the user. For example if the user inputs 3 then the program should output 2, while if the user inputs 6 then the program should output 8. Debug this code so it works as intended.

The Code Given:

import java.util.Scanner;

public class U6_L1_Activity_Two{
public static void main(String[] args){
int[h] = new int[10];
0 = h[0];
1 = h[1];
h[2] = h[0] + h[1];
h[3] = h[1] + h[2];
h[4] = h[2] + h[3];
h[5] = h[3] + h[4];
h[6] = h[4] + h[5];
h[7] = h[5] + h[6];
h[8] = h[6] + h[7]
h[9] = h[7] + h[8];
h[10] = h[8] + h[9];
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
if (i >= 0 && i < 10)
System.out.println(h(i));
}
}
User Dilan Sanjaya
by
5.7k points