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
Bad White [126]
3 years ago
15

2.2 code practice

Computers and Technology
2 answers:
denis23 [38]3 years ago
7 0

Answer:

I have used Python Language for this question. Code

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))

c = int(input("Enter third number: "))

print("The sum of these numbers is", a + b + c)

Explanation:

a, b and c are variables in the code. int is a command used to convert string into an integer(if possible). input is also a command. It is used to take input from the user. Whenever we make an input to take a number as a input it will be stored in a string not in an integer. The numbers/strings are stored in their variables. At last, I have used print function, which is used to print an integer or any string. To print the sum of numbers taken as input, I add them using their variables name, used in it. We can also give an integer and a string at same as a output by adding them. I know 2 ways to add an integer and a string. But, I have used the easy one for you in the code, and will explain that only. To add a string and an integer first you need to write print() function. Now, write write two quotes in the bracket of print function. Now, write the string you want in the quotes. After writing the string type one comma just after quotes, and type the number you want after comma. You can also write the integer before string by writing the number then comma and then string in quotes. You can also write more string or integer by typing comma then string/integer...

Definition of words I used in the explanation.

Variables: It is used to store any number, string, code etc. For example, a = 23. So, the variable <u>a</u> store the number 23, or b = "This is a string". So, the variable <u>b</u> stores the string etc.

String: It is stored as a sentence, or alphabet not as a number. For example, a = "This is a string", or b = "23". 23 is a number but, it is written between quotes that's why its not a number is a string.

If you have any doubt related my explanation, ask me in comment.

Elan Coil [88]3 years ago
4 0

this is for python correct?

You might be interested in
How does a hard drive work
IgorC [24]
You just have to put it into a computer and a file is gonna come up
7 0
3 years ago
Read 2 more answers
A ____ is harmful computer code that spreads without your interaction, slipping from one network to another and replicating itse
blondinia [14]
Malware is the answer

3 0
4 years ago
From your first impressions, write down what first comes to mind as to what is good or bad about the way the website/system work
suter [353]

Answer: I will consider the factors below

Usability: A measure of a user’s ability to arrive on a site, use it easily, and complete the desired task. Remember, we’re designing websites, where there is flow, rather than focusing on page design and assuming everything will flow later.

Explanation:

1.) It should be easy for the user to become familiar with and competent in using the user interface on the first contact with the website. If we take a travel agent’s website that a designer has made well, the user should be able to move through the sequence of actions to book a ticket quickly.

2.) It should be easy for users to achieve their objective through using the website. If a user has the goal of booking a flight, a good design will guide him/her through the easiest process to purchase that ticket.

3.) It should be easy to recall the user interface and how to use it on subsequent visits. So, a good design on the travel agent’s site means the user should learn from the first time and book a second ticket just as easily.

4.) We also consider user's experience

5.) The hosting server of the website

6.) Usability: A measure of a user’s ability to arrive on a site, use it easily, and complete the desired task. Remember, we’re designing websites, where there is flow, rather than focusing on page design and assuming everything will flow later.

4 0
4 years ago
A half-life is the amount of time it takes for a substance or entity to fall to half its original value. Caffeine has a half-lif
Elena L [17]

Answer:

// here is code in java.

import java.util.*;

class Solution

{

// main method of class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // declare variable

         double caffeine;

    // scanner object to read input from user

       Scanner scr=new Scanner(System.in);

       System.out.print("Enter the initial amount of caffeine:");

        // read the initial amount of caffeine

           caffeine=scr.nextDouble();

          // calculate amount of caffeine after 6,12,18 hours

          for(int i=1;i<=3;i++)

          {

               System.out.println("After "+ i*6+" hours:"+(caffeine/2)+" mg");

               // update the caffeine after every 6 hours

               caffeine=caffeine/2;

          }

                 

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create a variable "caffeine" to store the initial amount of caffeine given by user. Run a loop for three time, it will calculate the amount of caffeine left after every 6 hours.First it will give the amount of caffeine left after 6 hours, then caffeine left after 12 hours and in last caffeine after 18 hours.

Output:

Enter the initial amount of caffeine:100

After6 hours:50.0 mg

After12 hours:25.0 mg

After18 hours:12.5 mg

8 0
4 years ago
Meg[] elements = {new Lois(), new Stewie(), new Meg(), new Brian()}; for (int i =0; i
Stells [14]

Complete question is attached as snapshot.

Answer:

This will result in a compilation error.

Here's the inheritance hierarchy:

Meg -> Lois -> Brian -> Stewie

Now Meg has 2 public Fxns, a() and toString().

Lois inherits from Meg and all its public functions as well but, overrides the a() fxn of its super class.

So finally Lois has fxns a(), b() and toString().

Brian extends Lois and inherits all the above listed fxns of Lois, but overrides the b() and toString() fxns.

Stewie extends Brian and inherits all the fxns of Brian, but overrides the a() and toString() fxns.

In the Main driver fxn, we call a() and b() methods of all these classes but, the base class Meg has no b() and it is not extending any class so its not available in its scope.

This results in a compilation error.

Explanation:

7 0
3 years ago
Other questions:
  • What is the absolute pathname of the YUM configuration file? REMEMBER: An absolute pathname begins with a forward slash
    12·1 answer
  • What are the primary functions of motor oil? a. Reduce friction and prevent wear b. Keep engine surfaces clean c. Remove heat to
    11·1 answer
  • Professional photography is a competitive job field. <br> true <br> false
    12·2 answers
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    6·1 answer
  • Which best describes the Help feature of Word?
    13·2 answers
  • PLS HURRY!!<br> Look at the image below!
    7·1 answer
  • Mathematics and computer science share many concepts.
    5·2 answers
  • X= [12,67,89,34,56,90,67]
    6·1 answer
  • Discuss the communicatin process giving detailed explanation on each process​
    11·1 answer
  • Why would a programmer use the logical operator or in an if statement? (5 points)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!