answer.
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
Arisa [49]
1 year ago
11

Type two statements.

Computers and Technology
1 answer:
UNO [17]1 year ago
7 0

Answer:

Following are the program in Python langauge

person_name = input() # Read the person name by the user

person_age=0  #declared a vaiable person_age  

person_age = int(input()) # read person_age by the user

person_age=person_age+5  # add 5 to person_age

print('In 5 years',person_name,'will be',person_age) # display the output

Output:

  Amy

   4

   In 5 years Amy will be 9

Explanation :

Following is the description of code:

  • Read the value of the "person_name" variable by the user by using the input function.
  • Declared a variable person_age and initialized 0 with them.
  • Read the value of "person_age" variable by user by using input function and convert into int by using int function
  • Add 5 to "person_age" variable and store again them into the "person_age" variable.
  • Finally, display the output which is mention in the question.
You might be interested in
We Deliver trains its truck loaders how to set the packages in the delivery vehicles, so that when delivery drivers are pulling
damaskus [11]

Answer:

We Deliver trains its truck loaders how to set the packages in the delivery vehicles, so that when delivery drivers are pulling packages off their trucks, they are organized in a specific order and with the label facing forward to reduce errors and save time. A <u>Procedure </u>is being implemented when directing that the trucks be loaded in this specific manner.

Explanation:

Procedure is the method or set of instructions to perform some operation in specific order to complete the task in an organized manner. It is the type of directions to perform some operations.

In above mentioned case, if we want that the packages should set in some organized manner such as labeling face of package in forward direction so that, chance of error should reduce and time save. We should provide some procedure to the truck loaders.

5 0
2 years ago
George has to present the goals of information management to his team member. What is a goal of information management? The goal
Law Incorporation [45]

Answer:

The purpose of information management is to: design, develop, manage, and use information with insight and innovation. support decision making and create value for individuals, organizations, communities, and societies.

Explanation:

5 0
1 year ago
Jeff wants to be an archeologist. He found the information below and wants to properly cite it for his own use. The information
saw5 [17]
<span>“Detail Report for 15-1199.11-Archeologist.” O*NET OnLine. n.p., 2012. Web. 5 May 2013.</span>
7 0
1 year ago
Read 2 more answers
Karen just finished typing an important memo that she needs to send to many people, including the president of the company. Kare
S_A_V [24]
<span>C. proofread her work carefully, ask a coworker to look it over, and correct all mistakes
</span>
5 0
2 years ago
Read 2 more answers
(Displaying a Sentence with Its Words Reversed) Write an application that inputs a line of text, tokenizes the line with String
Serjik [45]

Answer:

I am writing a JAVA and Python program. Let me know if you want the program in some other programming language.

import java.util.Scanner; // class for taking input from user

public class Reverse{ //class to reverse a sentence

public static void main(String[] args) { //start of main() function body

Scanner input = new Scanner(System.in); //create a Scanner class object

   System.out.print("Enter a sentence: "); //prompts user to enter a sentence

   String sentence = input.nextLine(); // scans and reads input sentence

   String[] tokens = sentence.split(" "); // split the sentence into tokens using split() method and a space as delimiter

   for (int i = tokens.length - 1; i >= 0; i--) { //loop that iterates through the tokens of the sentence in reverse order

       System.out.println(tokens[i]); } } } // print the sentence tokens in reverse order

Explanation:

In JAVA program the user is asked to input a sentence. The sentence is then broken into tokens using split() method. split method returns an array of strings after splitting or breaking the sentence based on the delimiter. Here the delimiter used is space characters. So split() method splits the sentence into tokens based on the space as delimiter to separate the words in the sentence. Next the for loop is used to iterate through the tokens as following:

Suppose the input sentence is "How are you"

After split() method it becomes:

How

are

you

Next the loop has a variable i which initialized to the tokens.length-1. This loop will continue to execute till the value of i remains greater than or equals to 0.

for (int i = tokens.length - 1; i >= 0; i--)

The length of first token i.e you is 3 so the loop executes and prints the word you.

Then at next iteration the value of i is decremented by 1 and now it points at the token are and prints the word are

Next iteration the value of i is again decremented by i and it prints the word How.

This can be achieved in Python as:

def reverse(sentence):

   rev_tokens = ' '.join(reversed(sentence.split(' ')))

   return rev_tokens

   

line = input("enter a sentence: ")

print((reverse(line)))

The method reverse takes a sentence as parameter. Then rev_tokens = ' '.join(reversed(sentence.split(' ')))  statement first splits the sentence into array of words/tokens using space as a delimiter. Next reversed() method returns the reversed sentence.  Next the join() method join the reversed words of the sentence using a space separator ' '.join(). If you want to represent the reversed tokens each in a separate line then change the above statement as follows:

rev_tokens = '\n'.join(reversed(sentence.split(' ')))  

Here the join method joins the reversed words separating them with a new line.

Simply input a line of text and call this reverse() method by passing the input line to it.

4 0
1 year ago
Other questions:
  • In three to four sentences, describe why CEOs (the chief executive officers, that is, the leaders of large companies) make very
    9·1 answer
  • Which of the following is not a benefit of active listening?
    8·1 answer
  • When a switch configuration includes a user-defined error threshold on a per-port basis, to which switching method will the swit
    13·1 answer
  • The overall purpose of CSS is to modify the way web pages look without modifying the underlying HTML code. way tables render in
    12·2 answers
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • You need to design a data storage scheme for Hayseed Heaven library data system. There are several hundred thousand large data r
    8·1 answer
  • Through which of the devices listed are we able to connect to wireless networks? Check all that apply.
    14·1 answer
  • Which 2 problems does the Pay down credit card workflow solve for clients? (Select all that apply) It helps clients stay on top
    15·1 answer
  • Which group contains the command to manually conduct a spell check ?
    9·1 answer
  • In this problem, you will derive the efficiency of a CSMA/CD-like multiple access protocol. In this protocol, time is slotted an
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!