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
riadik2000 [5.3K]
2 years ago
9

Edhesive Intro to CS Code Practice 1.8

Computers and Technology
1 answer:
Nonamiya [84]2 years ago
6 0

<em>Questions:</em>

<em>CS Code Practice 1.8  Question 1:</em>

<em>Write a code that accepts the user's age as an input, then print their age in 10 years.</em>

<em></em>

<em>CS Code Practice 1.8  Question 2:</em>

<em>Write a code that accepts a whole number as an input, subtracts 5 and print the answer</em>

<em></em>

Answer:

Question 1:

currentage = int(input("Enter your age: "))

print("Your age in 10 years is "+str(currentage + 10))

Question 2:

userinput = int(input("Enter a whole number: "))

print(str(userinput)+" - "+str(5)+" = "+str(userinput - 5))

Explanation:

There are two questions in this category and I don't know which of them you need; So, I answered both.

Question 1:

This line prompts user for age

currentage = int(input("Enter your age: "))

This line adds 10 to user input and prints the result

print("Your age in 10 years is "+str(currentage + 10))

Question 2:

This line prompts user for a whole number

userinput = int(input("Enter a whole number: "))

This line subtracts 5 from the whole number and prints the result

print(str(userinput)+" - "+str(5)+" = "+str(userinput - 5))

You might be interested in
1. Briefly explain the concept of signature of a function, in a function declaration. What signature components are crucial for
Irina18 [472]

Answer:

Function signature can be defined as a combined term used to refer to the function name, function return type, no of arguments , type of arguments.

Explanation:

The signature of function is seen as a combined term used to refer to the function name, function return type, number of arguments , type of arguments.

When overloaded functions is been defined, they are different in numbet of arguments or type of argument passed.

To understand this better refer to the program code below.

C++ code.

#include <iostream>

using namespace std;

int multiply(int a, int b)

{

cout << a*b <<endl;

return 0;

}

int multiply(int a, int b, int c)

{

cout << a*b*c <<endl;

return 0;

}

int main()

{

//function with two arguments passed

multiply(3, 50);

//function with three arguments passed . It is different in number of arguments passed. Thus here function signature is different

multiply(4, 20, 10);

}

6 0
3 years ago
You created the following dictionary relationships = {'Jimmy':'brother', 'Carol':'sister'}. You then executed the following code
dybincka [34]

Answer:

This is because the key in relationships['jimmy'] is wrong. The first letter "j" should be uppercase. The key in the given dictionary is "Jimmy" and therefore a lowercase "j" will result in a KeyError exception. The key is case sensitive and therefore a minor mistake in a single letter either in lowercase or uppercase will cause the error. The correct usage of key to address the value should be relationships["Jimmy"].

3 0
3 years ago
Using refracted laser light to store data on a photoreceptive substrate is essentially how ___ storage works. Theoretically this
Alina [70]

Answer:

I try to search the answer but I couldn't find it

4 0
3 years ago
As you apply to college when should you apply for financial aid
Nataliya [291]

Answer:

after you are accepted in the college

Explanation:

You should apply for admission to the colleges you are interested in BEFORE filing your FAFSA. Once you are accepted to the colleges you have applied to, you can add those schools to receive financial aid award offers from when you file your FAFSA.

4 0
3 years ago
Harvey is not happy with the software that allows the programmer to write and run code and wants to find something new. If Harve
Assoli18 [71]

Answer:

D. integrated development environment

Explanation:

Given that an integrated development environment is a form of computer software App that allows the users or programmers to develop a software App in a way the enables them to carry out different operations including source code development, build and test automation, and debugging activities.

For example NetBeans, Eclipse, IntelliJ, and Visual Studio.

Hence, in this case, the correct answer is "integrated development environment."

3 0
3 years ago
Other questions:
  • In fiberoptic cable, the signal source is__________waves
    7·1 answer
  • Given that the variables x and y have already been declared and assigned values, write an expression that evaluates to true if x
    15·1 answer
  • Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fe
    13·1 answer
  • Rainfall_mi is a string that contains the average number of inches of rainfall in Michigan for every month (in inches) with ever
    12·1 answer
  • Biomimicry is the term used when engineers are inspired by objects found in nature? Group of answer choices True False
    10·1 answer
  • How do ice and water on the ground affect incoming solar radiation? They filter 22 percent of solar radiation that reaches the s
    9·2 answers
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • Which of the following is constantly changing and advancing?
    11·1 answer
  • Which is the correct expansion of the term Internet?
    15·2 answers
  • True or false scientists investigate and seek to explain the natural world
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!