If an app asks for a user's age, it may be because the app requires a user to be over a certain age to use some of the services it provides. Write a function called checkAge that takes one parameter of type String. The function should try to convert this parameter into an Int value and then check if the user is over 18 years old. If he/she is old enough, print "Welcome!", otherwise print "Sorry, but you aren't old enough to use our app." If the String parameter cannot be converted into an Int value, print "Sorry, something went wrong. Can you please re-enter your age?" Call the function and pass in userInputAge below as the single parameter. Then call the function and pass in a string that can be converted to an integer.
Go back and update your function to return the age as an integer. Will your function always return a value? Make sure your return type accurately reflects this. Call the function and print the return value.
func checkage(age: String)->Int?
{
if let age_type = Int(age)
{
if age_type > 18 {
return "Welcome!"
}
else if age_type < 18 {
return"Sorry, but you aren't old enough to use our app."
}
}
else {
return "Sorry, something went wrong. Can you please re-enter your age?"
}
return age_type
}
Answer and Explanation:
Here the programming language swift is being used. There is a slight error in the program shown above:
var userInputAge=9
func checkage(age: String)->int?
{
if let age_type = Int(age)
{
if age_type > 18 {
return "Welcome!"
}
else if age_type < 18 {
return"Sorry, but you aren't old enough to use our app."
}
}
else {
return "Sorry, something went wrong. Can you please re-enter your age?"
}
return age_type
}
The program should be revised :
func checkage(age: int?)->String
{
if let age_type = Int(age)
{
if age_type > 18 {
return "Welcome!"
}
else if age_type < 18 {
return"Sorry, but you aren't old enough to use our app."
}
}
else {
return "Sorry, something went wrong. Can you please re-enter your age?"
}
return age_type
}
We call the functions :
checkage(userInputAge)
checkage("15")
Note: we revised the program for errors in the first line of the code where the int optional parameter(int?) was supposed to be used instead of the String parameter in the function. We then called the function using the userInputAge variable defined as the parameter and then we now also used a String as the parameter for calling the function the second time.
Answer:
def checkage(age: "String")->int:
if age >= 18:
return "Welcome!"
return "Sorry, but you aren't old enough to use our app."
for _ in iter(list,0):
myage = int(input("Please enter your age: "))
if myage is int(myage):
result = checkage(myage)
print(result)
break
print("Sorry, something went wrong. Enter integer value as age.")
Explanation:
The python code above lets the user input the age value for continuous comparison. If the age is an integer, it checks to know if the age is greater than 18 or not. If yes, it returns "Welcome!" else "Sorry, but you aren't old enough to use our app". But if the age is not an integer, it displays the message "Sorry, something went wrong. Can you please re-enter your age?" then prompts the user again for the age.
Note: the ': "String" ' and "->int" is for documentation purposes. They are used to describe the type of parameters (for later) and return value (the former).
Internet entities (routers, switches, DNS servers, Web servers, user end systems, and so on) often need to communicate securely. Give three specific example pairs of Internet entities that may want secure communication.
Answer: See explanation
Explanation:
A secure connection simply means when there's encryption of a connection through the use of security protocols so that data flowing between the nodew can be secured.
Examples of Internet entities that may want secure communication include:
i. Two routers
ii. Our laptop and web server.
iii. Connection that exists between two DNS name servers.
which is the best software application to be used by a hotel manager
Answer:
Cloudbeds
:))
hope it helps
Q1 To remove filter
Option1: Click the Filter option of the Sort & Filter button in the Editing group on the HOME
Option2: Click the Filter option in the Sort & Filter group on the DATA tab.
Option3: Both 1 and 2
Option4: Pres DELETE
Answer:
Click DATA, Look for "Sort & Filter", Click Filter Box (right above "Sort & Filter"). Done.
Answer:
add a picture pls
Explanation:
____________________________ and _________________________ are 2 negative impacts of the internet on businesses.
A)Unlimited Availability and Low Confidence in the business
B)Competition and Poor Impersonality
C)Competition and Unlimited Availability
D)Low Confidence in the business and Improved Communication
Answer:
i no you its me remember and the answer is b.
Explanation:
PowerPoint is a visual aid for many speakers. Discuss some points to remember when adding text to a PowerPoint presentation. How do they help make the experience better for the audience and the presenter? What things can you do when creating a PowerPoint presentation to assure that your work adds to the speaker’s presentation without detracting attention from the speaker?
Answer:
Use a lot of spinning animations to draw attention. Use many colors. A lot of text so you can read from the slide in case you get lost.
Consider sending a packet from a source host to a destination host over a fixed route. List the delay components in the end-to-end delay. Which of these delays are constant and which are variable? Draw a picture to illustrate your network and where each type of delay occurs.
The delay components in the end-to-end delay are processing delay, Transmission delay, Propagation delay, and Queuing delay.
What is an end-to-end Delay?End-to-end delay, also known as one-way delay, is the length of time it takes for a packet to go from its source to its destination across a network. It is a word frequently used in the monitoring of IP networks, and it varies from round-trip time in that only the path from source to destination is measured.
Now according to the question, the propagation, transmission, and processing delays are all constant. The time required to send data bits is the cause.
Variable queuing delays exist.
The waiting time is dependent on packet size, and only one packet can be transferred at a time in the queue process.
To get more information about End-to-End delay :
https://brainly.com/question/28584250
#SPJ2
Handoff points in cross-functional flowcharts are of particular importance to process analysis.A. True B. False
Answer:
True
Explanation:
For python, Write a function named getResults that accepts radius of a sphere and returns the volume and surface area. Call this function with radius = 3.5 , and display results in one decimal format.
volume = 4/3 * pi * r ^ 3
Surface Area = 4pi * r ^ 2
import math
def getResults(r):
return "Volume = {}\nSurface Area = {}".format(round((4/3)*math.pi*(r**3),1), round((4*math.pi)*(r**2),1))
print(getResults(3.5))
I hope this helps!
Internet routing:_________. A. precomputes the most efficient route and uses it to ensure rapid packet delivery. B. broadcasts all packets to all hosts so the recipient will be sure to see its traffic. C. makes routing decisions one at a time as a packet crosses individual networks. D. uses port numbers to optimize the transmission of streaming media.
Answer:
A. precomputes the most efficient route and uses it to ensure rapid packet delivery.
Explanation:
In simple words, what Internet routing means is a process where a router decides which path data packets should follow that are more efficient in delivering the packets across computers.
For example, we can liken the process to the duties of a tour guide in a museum or large building in directing visiting guests who came to explore the museum.
Your personal opinion about what a "successful" console in the future will need to include to sell well. How have the changes in technology, gaming culture, and overall society affected the market?
Answer:
The answer is below
Explanation:
In my personal opinion what a "successful" console in the future will need to include to sell well is "a big library of games." This feature will help a console supports many games that will appeal to all categories of gamers.
The changes in technology, gaming culture, and overall society has affected the game market in many ways such as:
1. In terms of technology: it has made the game manufacturers both the console and third-party game developers to improve their gaming features. For example, the advancement in gaming pads becoming wireless. The gaming console having internet or online features, where gamers can play with each other around the world from their rooms. Also, the gaming character design looking more and more like the real-life personality it represents.
2. In terms of gaming culture: modern games are no longer for teenagers alone. It is now appealing to adults as well. This is evident in football players and coaches playing the games and talking about it. Even some players tend to influence their ratings in the game by mentioning how good they are in the press in comparison to the rating game developers are giving them.
3. Overall society has now seen gaming consoles as part of everyday life. The parents, researchers, and even feminist groups are now well aware of the gaming industry. And each of the stakeholders involved is influenced by how the game consoles manufacturers market their games through media, sports personalities, celebrities, etc.
The string expression strVar.____________________ starts at index pos, replaces the next n characters of strVar with all the characters of str.
Answer:
strVar.replace(pos, n, str);
Explanation:
The strVar.replace() is a javascript function of searching and replacing a string for a defined value, whereby it finds and returns a new string where the defined values are replaced.
For example: to return a string where "Trump" is replaced with "Biden":
We have
var str = "Welcome Trump!";
var res = str.replace("Trump", "Biden", str);
Hence, in this case, the correct answer is strVar.replace(pos, n, str);
anyone know how to fix black screen of death on computer
Answer:
you asked a question so you must have fixed it
Explanation:
logic
Which role will grant a delegate read-only access to a particular workspace within a user’s Outlook mailbox?
Author
Editor
Contributor
Reviewer
The role that will grant a delegate read-only access to a particular workspace within a user's Outlook mailbox is the "Reviewer" role.
In Outlook, delegates are individuals who are granted permission to access and manage another user's mailbox on their behalf. When assigning delegate permissions, different roles can be assigned to control the level of access the delegate has.
The "Reviewer" role specifically provides read-only access to the specified workspace within the user's mailbox. Delegates with this role can view the content, including emails, calendar events, and other items, but they cannot make any changes or modifications.
On the other hand, the "Author" role grants read and write access, allowing delegates to create, modify, and delete items within the designated workspace. The "Editor" role also provides read and write access but includes additional privileges such as creating subfolders and managing permissions.
The "Contributor" role allows delegates to create items within the workspace, but they cannot view items created by others. It provides a limited level of access compared to the "Reviewer" role.
Therefore, if a delegate needs read-only access to a particular workspace within a user's Outlook mailbox, the "Reviewer" role should be assigned.
For more questions on Reviewer, click on:
https://brainly.com/question/30517194
#SPJ8
Which of the following is considered an input device?
Answer:
Keyboard
Mouse
Light pen
Microphone
Touch pad
What is the purpose of a poster frame?
to allow the contents of an embed code to be displayed
to insert a downloaded video for offline playback and editing
to create the frame in which a screen recording will be inserted
to capture a portion of a video clip to show as a preview image
Answer: the last one
Explanation:
Here is the answer::
The art element line is a moving point.
True or False
It is acceptable to create two TCP connections on the same server/port doublet from the same client/port doublet. True False
Answer:
False
Explanation:
would be blocked from server
What is the most effective way to identify improvement opportunities for value log
Answer:
Performance Improvement (PI) Champion performs Value Stream Mapping and identifies improvement opportunities
Explanation:
Performance Improvement (PI) Champion performs Value Stream Mapping and identifies improvement opportunities.
In other words, Value stream mapping is a strategy that is used to break down situations into pieces such as people, information, and materials involved in delivering services.
To do this, a distinct categorization is made into a value-adding category and a non-value-adding category. This helps to determine which elements add value to customers or not.
Thereby, removing unnecessary processes or steps which in turn increases productivity and value.
What is the definition of trouble shooting.
you are packing a mobile phone containing a lithium ion battery and you get a prompt on the screen to put a lithium ion label on the box. You have run out of such labels and have only lithium metal labels left. what should you do?
Answer:
Do not use such labels because they may be misleading and are unethical.
Explanation:
Note, there is a big difference in design between the two terms or labels. Lithium metal batteries are non-rechargeable batteries. In other words, they cannot be recharged after they run down. For example, most watches, calculators, or car keys are made of lithium metal batteries.
While Lithium-ion batteries (or Li-ion batteries) are rechargeable batteries , and they are commonly used by mobile phones, laptops, and other gadgets.
Therefore, with such differences in mind, it may be very misleading when someone in possession of the mobile phone sees the lithium metal labels; then thinks the battery is non-rechargeable.
There are different instructions that comes with labeling, lithium metal label is quite different from Lithium-ion labels and as such one cannot use one for the order.
What one should you do is to never use the lithium metal labels in place of Lithium-ion labels. It is better to go and get the required label. If not found, the mobile phone should not be packaged for transport.
One has to comply with the regulations regarding batteries and the packaging of lithium batteries.
Lithium Metal Batteries are known as primary battery. That is, they are non-rechargeable. They are said to have lithium metal or lithium compounds in them.
They have high energy density than other lithium batteries. They can be found in Watches , Calculators etc.
Lithium-ion batteries are known to be secondary battery. That is, they are said to be rechargeable in nature. They can be found in Mobile phones, Laptops etc.
When shipped, any packages that has lithium-ion batteries must be labeled with UN3480 or UN3481.
When shipped, any packages that has lithium metal batteries must be labeled with UN3090 or UN3091.
Learn more about Batteries from
https://brainly.com/question/24876978
I NEED HELPS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! UWU
jeremy has a handful of resisters and all of them except one have for bands the exception has three why?
Answer:
The 3 band resistor does not specify the tolerance.
Ususally this means the tolerance is 20%, which is not great.
Explanation:
The last band is typically the tolerance band, i.e., the lower the tolerance the more accurate the value as indicated by the other bands. In case of a 3 band code, there is no tolerance specified and you have to assume the default of 20%.
if there was no technological advancement what would be our society like
Answer:
WHAT SOCIETY?!
Every night we'd still be squatting in caves, hunched around campfires, waiting for the leopards to pick us off....
It's hard to have a society when your means of communication are nearly zero and therefore can't sustain the dialogue necessary to develop the shared values needed to form a society.
Just took a test and I got 5 wrong and I wanted to know the correct answers
Answer:
I need the pic
Explanation:
13 List five examples of functionality that can be added when using express
cards?
Answer:
This Answer Was Pasted Over From ayushisingh5
Explanation:
ExpressCards can connect a variety of devices to a computer including mobile broadband modems (sometimes called connect cards), IEEE 1394 (FireWire) connectors, USB connectors, Ethernet network ports, Serial ATA storage devices, solid-state drives, external enclosures for desktop-size PCI Express graphics cards and ...
Write a method named printGPA that takes in as a parameter a Scanner to read in user input, and calculates a student's grade point average. The user will type in input containing the student's name, then a number of scores, followed by that many integer scores. Then, the method will print out the average of all grades entered. Here are two example dialogues: Enter a student name: Maria Enter the number of courses: 5 Course 1 Grade: 72 Course 2 Grade: 91 Course 3 Grade: 84 Course 4 Grade: 89 Course 5 Grade: 78 Maria's grade is 82.8 Enter a student name: Jordan Enter the number of courses: 4 Course 1 Grade: 86 Course 2 Grade: 71 Course 3 Grade: 62 Course 4 Grade: 90 Jordan's grade is 77.25
import java.util.Scanner;
public class JavaApplication40 {
public static void printGPA(Scanner scan){
System.out.println("Enter a student name:");
String name = scan.nextLine();
System.out.println("Enter the number of courses:");
int courses = scan.nextInt();
double total = 0;
for (int i = 1; i <= courses; i++){
System.out.println("Course "+i+" Grade:");
double grade = scan.nextDouble();
total += grade;
}
System.out.println(name+"'s grade is "+(total/courses));
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
printGPA(scan);
}
}
I hope this helps!
A program that will ring a bell six times is what kind of program?
A. Edited
B. Iterative
C. Selection
D. Sequence
Answer:
D
Explanation:
because it is a sequence it does more than one thing
Answer:
B
Explanation:
I took the test
a good look of a web page depends upon?
Answer: See explanation
Explanation:
• Font size: The font size used matters a lot in order to enhance readability. The ideal font size should be 16 pixel for the main body text. This is vital in order to help enhance readability. It should be noted that a don't size that is lower or higher than that can lead to challenges with readability.
• Graphics and animation: Using of exciting graphics and animations on a website can help in giving the web page a good look, help in grabbing the attention of the user, and also increase engagement.
• Use of colours: The color chosen also helps to give a web page a good look. It should be noted that when choosing colors, it is ideal to choose two or at most three colors to use for a web page. Mixing different colors or using very bright colors is typically a turn off.
What is the first step a user should take toward generating an index?
--finding and marking words or phrases that should be included in the index
--making sure that headers at different levels are using consistent styles
--bolding every word or phrase that should be included in the index
--writing down information about the author and publisher of other books used
Answer:
I think that it's A
Explanation:
Why is it useful to have more than one possible path through a network for each pair of stations?
Answer:
Because if one path is crowded, then there is always another path to make it less crowded and it is more convenient
Explanation: