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
ladessa [460]
3 years ago
12

Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18, adds 1 to the variable adults

if age is 18 through 64, and adds 1 to the variable seniors if age is 65 or older.
Computers and Technology
1 answer:
Mama L [17]3 years ago
6 0

Answer:

Explanation:

data is a statement like

data 10,20, 30 , 40 , 50, 60 , 70, 80

\\the numbers represent ages.

For x := 1 to end of data do a[x]:=read(data)

\\ This is a comment. You could do this much easier if you just use three if statements rather than the if then else.

minor:=0;adult:=0;senior:=0;

while a[x] <> 0 do begin

age:= a[x]

if age < 19 then minor:=minor + 1;

If age > 18 then if age < 65 the adult:=adult + 1;

if age > 64 then senior := senior + 1;

end;

I have not declared the variables anywhere. That depends on what language you are using. The key step you  want are the three if statements. How you find out what's in them is another matter.

You might be interested in
Assignment 8: Personal Organizer (in edhesive or python please)
serg [7]

Answer:

eventName = []

eventMonth = []

eventDay = []

eventYear = []

def addEvent():

   userEventName = input("Enter event name: ")

   userEventMonth = int(input("Enter event month (1-12): "))

   userEventDay = int(input("Enter event day(1-31): "))

   userEventYear = int(input("Enter event year (Ex:2020): "))

   userEventMonth = validateMonth(userEventMonth)

   userEventDay = validateDay(userEventMonth,userEventDay,userEventYear)

   

   eventName.append(userEventName)

   eventMonth.append(userEventMonth)

   eventDay.append(userEventDay)

   eventYear.append(userEventYear)

   

def validateMonth(month):

   if month >= 1 and month <= 12:

       return month

   else:

       return 1

def validateDay(month,day,year):

   # invalid days

   if day < 1 or day > 31 :

       return 1

   

   # if the month is february

   if month == 2:

       isleap = False

       if year%4 == 0:

           if year%100 == 0:

               if year%400 == 0:

                   isleap = True

           else:

               isleap = True

       # if the year is leap

       if isleap:

           if day < 30:                

return day

           else:

               return 1

       else:

            if day < 29:

               return day

            else:

               return 1

           

    # month with 31 days

   if month in [1,3,5,7,8,10,12]:

       return day

    # month with 30 days

   if month in [4,6,9,11] and day < 31:

       return day

   else:

       return 1

           

def printEvents():

   print("****** LIST OF EVENTS *********")

   

   months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',

         'August', 'September', 'October', 'November', 'December']

   

   for index in range(len(eventName)):

       print(eventName[index])

       print("Date: "+months[eventMonth[index] -1]+ " " + str(eventDay[index]) + ", " + str(eventYear[index]))

def printEventsForMonth(month):

   months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',

         'August', 'September', 'October', 'November', 'December']

   print("****** EVENTS IN " + months[month -1] + " *********")

   

   for index in range(len(eventName)):

       if eventMonth[index] == month:

           print(eventName[index])

           print("Date: "+months[eventMonth[index] -1]+ " " + str(eventDay[index]) + ", " + str(eventYear[index]))

userChoice = "yes"

while userChoice.upper() != "NO":

   addEvent()

   userChoice = input("Do you want to enter another event? NO to stop: ")

printEvents()

Explanation:

hope this saved somebody from a mental breakdown :)

3 0
3 years ago
Read 2 more answers
Wright a 3 paragraph 5 sentences per graph story bout computers or the internet
boyakko [2]

Ah yes, technology.

Firsly, let's start at the begining. Because we can't have internet without computers. Think of it from the old quote, "Which came first? The chicken or the egg?"

Computers, or the very first programmable one was created by German Konrad Zuse. A man with too much free time, invented a computer in his parents' living room. And yes, it was considered  to be the very first electromechanical binary programmable PC. He called it the "Z1". There's actually no right answer to this to be quite frank, considering the many different classifications you'd call a computer back then.

Why was the computer invented? Why, where would we be without it? Certainly not here (hence brainly and you asking this question). Computers were created for the sole purpose of a repetitive calculation to perform more quick and accurately information.

5 0
3 years ago
Some email programs let you use a ____ to move incoming mail to a specific folder or to delete it automatically based on the con
KatRina [158]

Answer:

filter

Explanation:

Some email programs let you use a filter to move incoming mail to a specific folder or to delete it automatically based on the content of the message.​

The filter performs this role by either automatically deleting or moving to another location.

Most messages that are moved or deleted are unsolicited emails or spam messages.

Filtering of your mails helps so you ou can manage your incoming mail using filters to send email to a label, or archive, delete, star, or automatically forward your mail.

This is a way of organising your correspondence.

6 0
3 years ago
Select the correct answer. Which is a cause for quality issues in IS implementation? A. Accurate documentation is not available
bogdanovich [222]

Answer:

B. The scope of the project increases due to change requests from clients.

mark me branliyest

5 0
3 years ago
Read 2 more answers
Key exchange is so important that you should write your own to avoid bugs in other people s libraries. (
lana [24]

Answer:

The answer to this question is the option "a".

Explanation:

key exchange is a method of cryptography(It is a method of protecting data through the use of codes like [email protected]#.) by which the data exchange between two parties. It follows a cryptographic algorithm. The key exchange also used for key establishment.key exchange is used for data encryption so the answer to this question is true.

8 0
3 years ago
Other questions:
  • Repetition learning rates are the same for everyone, so there is no need to find an activation and break pattern that works
    12·2 answers
  • Abigail is interested in connecting her tablet that usually connects to a wireless network, to her personal computer that usuall
    11·2 answers
  • In Microsoft Excel graphs are referred to as ______?
    14·2 answers
  • PLEASE HELP YOU GUYS
    7·2 answers
  • Employees of ABC company uploaded files on a shared server with unique file naming conventions. However, they faced problems whi
    15·2 answers
  • Write a statement containing a logical expression that assigns true to the
    13·1 answer
  • Which game would be classified as an advergame? A. Tomb Raider B. Fifa Soccer C. Prince of Persia D. Flower
    9·1 answer
  • Consider the following Ordinary Differential Equation:ODE : d 2y dx2 + 5 dy dx + 4y = 1 x ∈ [0; 1] BC : y(0) = 1; y 00(1) = 0 Us
    9·1 answer
  • Which search phrase is the most effective to find out about the most popular pizza chains worldwide in 2019?
    9·2 answers
  • What are the common internal components to most electronic devices?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!