1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ICE Princess25 [194]
2 years ago
10

Write a program that asks the student for his name and the month in which he/she was born. Students are then divided into sectio

ns, according to the following: Section A: Name starts between A - E Born between months 1 - 6 Section B: Name starts between F - L Born between months 1 - 6 Section C: Name starts between M - Q Born between months 7 - 12 Section D: Name starts between R - Z Born between months 7 - 12 Section E: All others
Computers and Technology
1 answer:
natima [27]2 years ago
5 0

The program is an illustration of loops and conditional statements

<h3>What is a loop?</h3>

A loop is a program statement that is used to perform repetitive operations

<h3>What is a conditional statement?</h3>

A conditional statement is a statement that is used to make decisions

<h3>The main program</h3>

The program written in Python, where comments are used to explain each line is as follows:

#This creates an empty list for the sections

A = []; B = []; C = []; D = []; E = []

#This gets input for the number of students

count = int(input("Number of students: "))

#This iterates count times

for i in range(count):

   #This gets the name of each student

   name = input("Name: ").upper()

   #This gets the birth month

   month = int(input("Month: "))

   #The following if conditions determine the section of the student

   if name[0] in ['A','B','C','D','E'] and (month >= 1 and month <=6):

       A.append(name)

   elif name[0] in ['F','G','H','I','J','K','L'] and (month >= 1 and month <=6):

       B.append(name)

   elif name[0] in ['M','N','O','P','Q'] and (month >= 7 and month <=12):

       C.append(name)

   elif name[0] in ['R','S','T','U','V','W','X','Y','Z'] and (month >= 7 and month <=12):

       D.append(name)

   else:

       E.append(name)

#This prints the students in each section

print(A,B,C,D,E)

Read more about loops and conditional statements at:

brainly.com/question/24833629

You might be interested in
What is the value of alpha[4] after the following code executes? int[] alpha = new int[5]; for (int j = 0; j &lt; 5; j++) alpha[
LUCKY_DIMON [66]

Answer:

7

Explanation:

alpha[4] = 2*4 - 1, which evaluates to 7.

4 0
3 years ago
Based on the data definition classes identified below, assume you wish to create a Dictionary class that inherits from the Book
Alex Ar [27]
<h2>Answer:</h2>

//==============================

// Book class

//==============================

public class Book {

private String title;

private double cost;

public Book(String title) {

 this(title, 0.00);

}

public Book(String title, double cost) {

 this.title = title;

 this.cost = cost;

}

public String getTitle() {  

 return this.title;  

}

public double getCost() {  

 return this.cost;  

}

}

//==============================

// Dictionary class

//==============================

public class Dictionary extends Book {

private double numWords;

// Create Contructor

public Dictionary(String title, double cost, double numWords){

 super(title, cost);

 this.numWords = numWords;

}

}

<h2>Explanation:</h2>

The actual response to this question is shown in bold face in the above.

Line 1:

public Dictionary(String title, double cost, double numWords){

Here the header for the constructor for the Dictionary class is written which takes in three parameters - <em>title, cost </em>and <em>numWords</em>. These parameters will be used to set the values of the instance variables of the Dictionary class.

Remember that the Dictionary class extends from the Book class. Therefore, in addition to its <em>numWords</em> attribute, the Dictionary class also has the <em>title</em> and <em>cost</em> attributes.

Line 2:

super(title, cost)

Here, since the Dictionary class inherits from the Book class, it can also call the constructor of Book class to initialize two of its three variables which are <em>title</em> and <em>cost. </em>Hence the need for the super() method keyword. In other words, the super() in the Dictionary class is the constructor from the parent class and it is used here to set the dictionary's <em>title </em>and <em>cost </em>attributes.

Line 3:

this.numWords = numWords;

Here, the only attribute left to be set is the <em>numWords</em>. Therefore, the 3rd line sets this attribute to the parameter passed into the constructor in line 1.

Line 4:

}

Here, the block containing the Dictionary class constructor is being closed.

7 0
3 years ago
how to Create a flowchart that will perform the multiplication, addition, subtraction and division of two numbers. First, the tw
tekilochka [14]
Start
↓
Ask for two numbers from user
↓
Store the numbers as A and B
↓
Perform
A + B = C
A - B = D
A x B = E
A / B = F
↓
Display as text
A + B = C
A - B = D
A x B = E
A / B = F
↓
End
7 0
4 years ago
Haley's employer has asked her to review tens of thousands of social media posts about their company's products and compile this
ArbitrLikvidat [17]

Answer: Variety

Explanation:

According to the given question, Haley is dealing with the variety of the organization products posts on the social media networking as Haley's employer wants to comping all the data or information related to the products into the database system.

  • The database is one of the type of management system that manages all the database that are shared by the customers or users.
  • The main important function of the database is that it organize the data more accurately and properly in the system.
  • The database management system (DBMS) handle all the data in the system more effectively from the variety of the users.

Therefore, Variety is the correct answer.

7 0
3 years ago
LIst types of computer process ?
vagabundo [1.1K]

Answer:

Transaction Processing.

Distributed Processing.

Real-time Processing.

Batch Processing.

Multiprocessing.

4 0
2 years ago
Other questions:
  • All jobs that involve the web require a computer science degree true or false
    12·2 answers
  • A boy is sitting to the side of a campfire. He is 5 feet away, but still feels warm. This is an example of:
    15·1 answer
  • A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
    11·2 answers
  • Which practice is the best option for desktop security? A. Make a unique user ID and password for each account. B. Change the pa
    9·2 answers
  • Which of the following statements is false? Question 16 options: A) With non-static interface methods, helper methods can now be
    12·2 answers
  • Which of the following statements is correct? Group of answer choices An object of type Employee can call the setProjectName met
    11·1 answer
  • HELLLLLLLLLLLLLLLLLLLLP PLSSSSSSSSSSS HELLLLLLLLLP
    14·1 answer
  • 1. What is the Internet?
    8·2 answers
  • Using web-safe fonts and colors is something you can do to increase blank
    11·1 answer
  • Python 4.5 code practice
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!