Write a console application that requests the user to enter the name of their Pet and the year their pet was born. Calculate the age of the pet and display the name and age of the pet.

Answers

Answer 1

Console applications are computer programs that run on text only interface

The main program

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

#This imports the date module

from datetime import date

#This gets the pet name

petName = input("Pet name: ")

#This gets the pet year of birth

petYear = int(input("Year of birth: "))

#This calculates the pet age

age = int(date.today().year) - petYear

#This prints the pet name and age

print(petName,' is',age,'years old')

Read more about computer programs at:

https://brainly.com/question/16397886


Related Questions

Briefly explain the Infrastructure challenges, Technology transfer issues, and Product
and service challenges

Answers

Answer:

asymmetric information, market power, and externalities

Explanation:

what dose a compress pictures command do ?

Answers

Answer: I reduces the size

Explanation: cropped areas of pictures are saved by default, which adds to the file size. If your using PowerPoint then it can reduce the file size by compressing pictures, like lowering their resolution, and deleting cropped areas.

You are the IT security administrator for a small corporate network. The HR director is concerned that an employee is doing something sneaky on the company's employee portal and has authorized you to hijack his web session so you can investigate.

Your task is to hijack a web session as follows:

a. On IT-Laptop, use Ettercap to sniff traffic between the employee's computer in Office1 and the gateway.
b. Initiate a man-in-the-middle attack to capture the session ID for the employee portal logon.
c. On Office1, log in to the employee portal on rmksupplies using Chrome and the following credentials: Username: bjackson Password:
d. On Office2, navigate to rmksupplies and use the cookie editor plug-in in Chrome to inject the session ID cookie. Verify that you hijacked the session.

Answers

Answer: A, it's the most professional way or C but I'd choose A

reference of generation of computers?​

Answers

Answer:

First Generation: Vacuum Tubes. Second Generation: Transistors. Third Generation: Integrated Circuits. Fourth Generation: Microprocessors. Fifth Generation: Artificial Intelligence

In order to use a data type, a variable must be _____________________ and _____________________.

memorized and initialized
declared and initialized
assigned and memorized
noted and declared

Answers

Answer:

declared and initialized

Explanation:

:))

Write a console application that requests the user to enter the name of their Pet and the year their pet was born.Calculate the age of the pet and display the name and age of the pet.

Answers

The console application that requests the user to enter the name of their Pet and the year their pet was born and calculate its age is as follows:

from datetime import date

def nameAndAge(x, y):

   today = date.today()

   age = today.year - y.year - ((today.month, today.day) < (y.month, y.day))

   return f"The name of your pet is {x} and the age is {age}"

   

# Driver code

print(nameAndAge("mike", date(1997, 2, 3)), "years")

Code explanation

The code is written in python.

we have to import date from datetime module.We declared a function named  "nameAndAge". The arguments of the function are the users input which are the name and date of birth of the pet.We store todays date in the variable called "today".Then we calculate the age of the pet.The next line of code, we returned the name and the age of the pet base on the users input.Finally, we call the function with the print statement.

learn more on python here: https://brainly.com/question/25285677

define a python functions that draw a pinwheel using the pinwheel function that has input paramiters that allows you to change the number of branches and size
then make on that does not use the pinwheel function to draw it

Answers

Start with your draw_pinwheel() function

During each iteration of the loop decide which color to set the turtle to using the color() function

On even iterations, use color1

On odd iterations, use color2

Use an if/else statement to do the decision making

After deciding the color, surround a call to draw_triangle() with begin_fill() and end_fill() so that drawing the triangle creates a colored triangle.

If you have have forgotten, you can use an if/else to check for even/oddness in python as follows.

my_number = 3

if(my_number % 2 == 0):     # the remainder of dividing by 2 is 0

   print("The number is "+str(my_number))

   print("The number is EVEN")

else:                       # the remainder must be 1

   print("The number is "+str(my_number))

   print("The number is ODD")

Good luck <3

Write a java program to input a number from the user and tell if that number is a power of 2 or not.
Powers of 2 are 1, 2, 4, 8, 16, 32, 64, 128, 256 and so on.

Answers

Answer:

 public static boolean isPowerOfTwo(int n) {

   long exp = Math.round(Math.log(n) / Math.log(2));

   return Math.pow(2, exp) == n;

 }

Explanation:

The opposite of power-of-2 is the 2-log, which is calculated using any log divided by log(2).

I'm sure you can do the input part yourself!

Which factor affects reading speed the most?
a.
The desire to improve speed
c.
The motivation to practice
b.
The willing to try new techniques
d.
These are all equal factors


Please select the best answer from the choices provided

A
B
C
D
Mark this and return

Answers

D of course because each one of them affects reading speed equally.

Answer:

D. these are all equal factors

Explanation:

i took the test lads

How is the increased use of smartphones and tablets, with their smaller screen size, affecting user interface design practices

Answers

Answer:

A small screen limits the information that can be legibly displayed. While designing, text and images can quickly consume the limited screen space, causing a trade-off between content and user interactions. Given that smartphones are equipped with touch-based interfaces that allow intuitive and dynamic interactions, an increase in screen size offers a larger surface for interactions and a greater sense of controllability. Large screens also enable the utilization of various communication modalities.

Explanation:

I hope this helps!

For what was the simulation game, America's Military, used?

Answers

America's Army, army training simulator and electronic game used for army recruitment and training. It was created in 2002 by Lieut.

large and fast disks should be used for as doing so will ensure work is done as quickly as possible?

Answers

Answer:  Well it depends, sometimes for a hard drive if you are using for an example, that would not really affect the performance on how big is it. But I think that it could impact the performance in a good way but maybe some people think that it's not so....

Explanation:

Well, that varies. For instance, depending on how big the hard disk is, performance may or may not be affected. However, I believe it could have a positive effect on performance, while perhaps others disagree.

What is the performance?

A play, concert, or another type of entertainment is staged or presented as a performance. It can also be described as the process or action of doing or completing a deed, task, or function. A qualitative methodology is known as "performance research" uses

The subject and method of the experiencing body are placed in time, place, and history. Instead of abstract or reductive encounters, the performance paradigm calls for a more direct experience, primarily through facework. For instance, depending on how big the hard disk is, performance may or may not be affected. However, I believe it could have a positive effect on performance, while perhaps others disagree.

Therefore, Well, that varies. For instance, depending on how big the hard disk is, performance

Learn more about performance here:

https://brainly.com/question/15466511

#SPJ2

Which popular video game franchise has released games with the subtitles World At War and Black Ops?

Answers

Answer:

Call of duty i think has released those games

Answer:

IT WAS CALL OF DUTY

Explanation:

drawing experiences in high school

Answers

We did the following

Turn Your Markers into Paint.
Stuffed Animal Drawings.
Drawing the Human Form.
Digital Drawing Ideas.
Visual Journaling Ideas.
Line Drawing Lessons.

An Internet Service Provider(ISP) has three different subscription
packages for its customers:

Package A: For $15 per month with 50 hours of access provided.
Additional hours are $2.00 per hour over 50 hours.
Assume usage is recorded in one-hour increments,


Package B: For $20 per month with 100 hours of access provided.
Additional hours are $1.50 per hour over 100 hours.


Package C: For $25 per month with 150 hours access is provided.
Additional hours are $1.00 per hour over 150 hours

Assume the Billing Cycle is 30 days.

The ISP has contracted us to write the application software for their
new Billing System.

We will do the project over the next two weeks:

WEEK 9 -- Write the Functions to do the tasks that we will be using
to develop the application in Week 10.
WEEK 10 -- Write an Interactive Console Application using the
Functions which you developed in Week 9.

===========================================================================
DESCRIPTION of PROBLEM SET for Week 9
===========================================================================

Write the Function Definitions for the following tasks needed by
the ISP Billing System.

getPackage
validPackage
getHours
validHours
calculatePkg_A
calculatePkg_B
calculatePkg_C
---------------------------------------------------------------------------
getPackage: get value (A, B, C) for selected package from the keyboard.

validPackage: ensure that the value entered is an (A,B,C).

getHours: get value (0 - 720) for hours of usage from the keyboard.

validHours: ensure that the value entered is between 0 and 720.

calculatePkg_A: calculates the monthly charges for internet usage
based on hours of usage when Package 'A' is selected.

Answers

Use the knowledge of computational language in C code to write a code that has three different subscription packages for its customers.

How to write code about sales?

To make it simpler the code is described as:

#include <iostream>

#include <string>

using namespace std;

int main() {

string package;

float time;

float price;

cout << "Choose package: ";

cin >> package;

// Package validation

if ((package == "A") || (package == "B") || (package == "C")) {

cout << "The number of hours: ";

cin >> time;

// Time validation

if (time <= 744) {

// Package A

if (package == "A") {

if (time > 50) {

price = 15 + (time - 50) * 2;

} else {

price = 15;

}

// Package B

} else if (package == "B") {

if (time > 100) {

price = 20 + (time - 100) * 1.5;

} else {

price = 20;

}

// Package C

} else if (package == "C") {

if (time > 150) {

price = 25 + (time - 150) * 1;

} else {

price = 25;

}

cout << "Price: $" << price;

}

See more about C code at brainly.com/question/19705654

what is a window with controls that you tell window what you want

Answers

Answer:

dialog box

I hope this helps you

:)

please help me with this. this my past homework and it's already stressing me out ehehe so it would make me happy if someone helped me :DD , please help me with atleast 5? thank you sm!​

Answers

Answer:

14. editor

8. managers

12. news

5. nameplate

10. dummy

A website has recently seen a spike in activity due to a recent marketing campaign that has caused a decrease in performance. The operators want to improve performance to their website. What should they implement?

Answers

Answer:

THEY SHOULD ADD CHEESE!

Explanation:

cheese solves everything,

1. (+) Peter will be taken to the airport by his father tomorrow.
(-)………………………………………………………………….
(?)………………………………………………………………….

Answers

the figure shows cross-section of a ruler which is a rectangle of 2. 5 cm by 0.2 cm on which surmounted an isosceles trapezium (one in which the non- parallel sides area of equal length). the shorter of the parallel sides of the trapezium 0.7 cm long.if the greatest height of the ruler is 0. 4 cm and it is 33 cm long,calculate its surface area

Which of the following is a field whose value uniquely identifies each record in a
table?
Main key
Value key
Primary key
Element key

Answers

A field whose value uniquely identifies each record in a table is called: C. Primary key.

What is DBMS?

DBMS is an acronym for database management system and it can be defined as a collection of software applications that enables computer users to create, store, modify, retrieve and manage data or information in a relational database.

This ultimately implies that, DBMS allow end users to efficiently store, retrieve and manage their data with an appropriate level of security.

In database management system (DBMS), a primary key is a field whose value uniquely identifies each record in a table or relational database.

Read more on primary key here: https://brainly.com/question/8131854

Cybercrime
Select 3 options.
is always intentional
O is always unintentional
O can be committed by an outsider
can be committed by an insider
O can be caused by negligence
help me please!?!

Answers

Answer:

O can be committed by an outsider

O can be committed by an insider

O can be caused by negligence

Explanation:

Cybercrime can be done by someone within the company and has access but it can also be done by someone outside through hacking.  Sometime someone broke the law without knowing it because of negligence.

Can someone give me a simple topic for a website please be creative make it simple! and fun for brainliest

Answers

Answer:

hmm you could talk about your dailylife , or stuff you like to do etc do what you like <3 , if you like art you could do that to!

Explanation:

Can someone give me a simple topic for a website? please be creative make it simple! and fun for brainliest

Because law enforcement cannot be everywhere at once, what kind of intelligence should be focused on in order to avoid potential cyber
threats?
А. preventative
B. international
c. democratic
D. top-secret

Answers

B. International. I just took the test.

Select all statements that are true of cable internet connections.

A. They're dial-up connections.
B. They're broadband connections.
C. They're wireless connections.
D. They're shared bandwidth connections.

Answers

The statements that are true of cable internet connections are:

They're broadband connections. They're shared bandwidth connections.

What is this connection about?

In telecommunications, cable Internet access is known to be cable Internet and it is said to be a kind of broadband Internet access that make use of the same tools as a cable television.

Note that  the statements that are true of cable internet connections are:

They're broadband connections. They're shared bandwidth connections.

Learn more about internet from

https://brainly.com/question/2780939

#SPJ2

Which would be considered a peripheral device?

A. a printer that can be connected from outside the computer to communicate with it

B. a CPU

C. RAM

D. an internal hardware part like a motherboard or hard drive

Answers

Answer:

D is the correct answer of this question

If there are cyber threats and vulnerabilities to your system, what does that expose you to ?


Answers

Answer:

It introduces the possibility of hackers or attackers targeting your system.

I hope this answers your question!

Define Auxiliary memory?​

Answers

Answer:

An Auxiliary memory is referred to as the lowest-cost, highest-space, and slowest-approach storage in a computer system. It is where programs and information are preserved for long-term storage or when not in direct use. The most typical auxiliary memory devices used in computer systems are magnetic disks and tapes. :)

An Auxiliary reminiscence is referred to as the bottom-value, highest-area, and slowest-method storage in a laptop system. it's miles wherein programs and facts are preserved for long-time period storage or when now not in direct use. The most standard auxiliary reminiscence devices used in computer structures are magnetic disks and tapes.

the information of an management information system comes from?

Answers

A management information system is a computer system consisting of hardware and software that serves as the backbone of an organization's operations

What are variables? Write the name of any two types of variables.

Answers

Answer:

A variable is an identifier which changes the values given to it when the program is being executed.

e.g. - var count : integer

var avg : real

Explanation:

Jane has an intent to penetrate the network in an organization. She has used passive reconnaissance to gather extensive information on the company. She finds out the model numbers of routers and other devices by reading discussions between system administrators in forums. She also has a list of all the IT staff and their phone numbers. She also has the services running on ports on some machines she ran a network scanner on.

Required:
a. What reasonable steps should the company have taken to prevent Jane from finding this information?
b. What steps should the company take to prevent or reduce the efficacy of port scans?

Answers

The  reasonable steps should the company have taken to prevent Jane from finding this information is to do a Vulnerability scanning or a A penetration test.

How To defend Against Port Scanning try and use or Install a Firewall and the use of TCP Wrappers.

What is  Vulnerability scanning?

This is a kind of passive reconnaissance techniques. This form of scanning is the process of auditing a said network. A vulnerability scanner is one that looks into the network or application to see issues but they do not attempt to exploit any vulnerabilities that is seen.

A penetration test (pen test) is known to be a form of ethical hacking that entails one to think like an attacker and find out ways to penetrate the target's security systems. This aim to:

Verify a threat exists.Bypass security controls.Actively test security controls.Exploit vulnerabilities.

Learn more about penetration test  from

https://brainly.com/question/26555003

Other Questions
Which of the following would increase the speed of the rock cycle?O Increased rainfallO Decreased sunlight O Decreased Earth temperature. Longhorn High School opens its door in 2005 with 800 students. The school grows 5% every year. How long will it take for the school to reach 3000 students? What is the value of f(2)A) -1B) -0.75C) 3D) 12 Read the following passage and complete the sentences with NO MORE THAN THREE WORDS.A study carried out in Germany has found that chocolate may be good for your heart. This is fantastic news for all chocolate lovers. The extensive research was conducted over eight years. The research team followed the chocolate-eating habits and health of almost 20,000 people. They compared how much chocolate was in their diet to the number of heart attacks and strokes people had. Lead researcher Brian Buijsse said: "The good news is that chocolate is not as bad as we used to think, and may even lower the risk of heart disease and stroke." Mr Buijsse said his team found that dark chocolate was the healthiest kind to eat: "Dark chocolate exhibits the greatest effects, milk chocolate fewer, and white chocolate no effects, he said.The German study showed that people who ate the most chocolate (at least one bar per week) reduced their risk of having a heart attack by 27 per cent. The risk of suffering a stroke was cut by as much as 48 per cent. Nutrition experts believe that natural compounds in chocolate called flavonols are good for our heart. Flavonols also help reduce blood pressureThey are found in cocoa beans so dark chocolate (which has more cocoa) contains more of them than milk chocolate (which has more fat). Buijsse wams people not to suddenly eat lots of chocolate: "Eating higher amounts ill most likely result in weight gain. If people start eating small amounts of chocolate, it should replace something else, preferably other high-calone sweets or snacks.1. The extensive research about chocolate lasted .....................2. According to researchers,.................is healthier than any other kinds of chocolate.3. People who ate the most chocolate reduced by 27 percent their risk of having..............4. The natural compounds in chocolate called flavonols are good for our heart and also help..............5. Eating higher amounts will possibly cause............. what is the fertility rate of japan Metals expand on____ and contract on _____ To rent a certain meeting room, a college charges a reservation fee of $31 and an additional fee of $5.70 per hour. The history club wants to spend less than $82.30 on renting the meeting room.What are the possible amounts of time for which they could rent the meeting room?Use for the number of hours the meeting room is rented, and solve your inequality for . answer for points !!!!!!! The bearing of P from Q is 046.The bearing of R from Q is 124.QR = QP.Work out the bearing of R from P. HELPPP PLEASE I"LL GIVE BRAINLEST TO THE FIRST PERSON WHO ANWSERS IT CORRECTLY !!!!!!!!!!!!!!!!!! Based on the thesaurus entry and the context of the sentence, use the drop-down menus to choose the best synonym for "hurdle" in each sentence. Use an online search engine to find a trusted online dictionary, then search and check the synonym definitions.The runners passed over each hurdle in a flash.Problem, Barrier , Drag .The largest hurdle in my plan to buy a car was lack of money.Problem, Barrier, Drag . Can somebody give me answers for these two questions. Who was the inventor of the blood tester Classification of computer Purpose personality ? (PLS HURRY literally begging) which of the following describe the governments of classical civilization1- they were able to adapt and change over time2- they struggle to manage the affairs of the people3- they cannot create an effective system of laws The plotadescribes the characters in a storybis what happens in a storytells about the author Do you believe that day light saving time should be permanent? Why or why not ? Must respond with at least 2 paragraphs I need help ASAP, please.. Name two sodium salts that may be prepared by reacting sodium hydroxide with dilute sulphuric acid. Which expression is a difference of squares with a factor of 5x 8? 25x2 16 25x2 16 25x2 64 25x2 64. If the phosphorus is present as phosphate ion (PO43-), how many moles of PO43- are present in 5.00 g of the 15-30-15 fertilizer? A silo (base not included) is to be constructed in the form of a cylinder surmounted by a hemisphere. The cost of construction per square unit of surface area is times as great for the hemisphere as it is for the cylindrical sidewall. Determine the dimensions to be used if the volume is fixed at cubic units and the cost of construction is to be kept to a minimum. Neglect the thickness of the silo and waste in construction