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
podryga [215]
3 years ago
11

What type of error occurred with the code below??

Computers and Technology
1 answer:
Butoxors [25]3 years ago
6 0

Answer:

ValueError

Explanation:

The string 'five' holds characters that are not numeric, meaning it will raise ValueError since the function int() does not accept arguments that are strings with characters that are not numbers/numeric.

Hope this helps :)

You might be interested in
Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, then the denominator. Make su
Anton [14]
<h2>Answer:</h2>

import java.util.Scanner;

public class FractionToDecimal {

   public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       

       System.out.println("Please enter the numerator");

       double numerator = input.nextDouble();

       System.out.println("Please enter the denominator");

       double denominator = input.nextDouble();

       

       if(denominator == 0){

           System.err.println("ERROR - Cannot divide by zero.");

       }

       else {

           System.out.println("The result is " + (numerator/denominator));

       }

       

   }

   

}

<h2>Explanation:</h2>

// import the Scanner class to allow for user input

import java.util.Scanner;

// 1. Declare a class

public class FractionToDecimal {

   // 2. Write the main method

   public static void main(String[] args) {

       

       // 3. Create an object of the Scanner class called <em>input</em>

       Scanner input = new Scanner(System.in);

       

       // 4. Prompt the user to supply the numerator

       System.out.println("Please enter the numerator");

       

       // 5. Declare and initialize a variable <em>numerator </em>to hold the numerator

       // supplied by the user.

       // The numerator is of type double since the program does not

       // specify any. With a double both integer and floating point numbers

       // will be supported.

       double numerator = input.nextDouble();

       

       // 6. Prompt the user to enter the denominator

       System.out.println("Please enter the denominator");

       // 7. Declare and initialize a variable <em>denominator </em>to hold the

       // denominator supplied by the user.

       // The denominator is also of type double since the program does not

       // specify any. With a double, both integer and floating point numbers

       // will be supported.

       double denominator = input.nextDouble();

       // 8. Check if the denominator is or is not zero.

       // if it is zero, display an error message        

       if(denominator == 0){

           System.err.println("ERROR - Cannot divide by zero.");

       }

       // if it is not zero, then print out the result of the division

       else {

           System.out.println("The result is " + (numerator/denominator));

       }

       

   }                       // end of main method

   

}                            // end of class declaration

Please Note:

The code above has been written in Java.

The explanation segment contains comments to explain every line of the code.

But a few things are still worth noting;

i. Dividing the numerator by the denominator will convert a fraction to decimal.

ii. The object of the Scanner class <em>input </em> is used to get the inputs (numerator and denominator) from the user. Since the inputs are going to be integers or doubles, the nextDouble() method of the the Scanner class is used.

iii. If the denominator is zero, an error message will be displayed. I have used the System.err.println() method for that rather than the regular System.out.println() method. The difference is that the former will print out the error text in red color.

iv. Notice also that the else statement in the code will perform the division and also print out the result of the division along side with some text.

<em>Hope this helps!</em>

3 0
3 years ago
Technologies are having a negative impact on businesses.
Aloiza [94]

Answer: False

Explanation: I think its false because technologie has had a good impact on businesses.

4 0
3 years ago
Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. The company's pr
Andrei [34K]

Answer:

B) shared workspace

Explanation:

There are various terms which are shown below:

Blogging: Blogging is the site in which the person shares its views and opinions about a certain topic. So that it can spread their knowledge throughout the world

Shared workspace: As the name suggests it is a document that is shared with the team members so that they can track any change made by the other team members so that it avoids the duplicate of files. It also reduced the cost and time.

Instant messaging: It is an online chat in which the receiver and the sender communicate with each other in a real-time

Cross-linking: The cross-linking is the technique which links one site to another with a motive to access another site.

So, according to the given scenario, the most appropriate option is b.

7 0
3 years ago
Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 38 then the outpu
Likurg_2 [28]

Answer:

Following are the program in the C++ Programming Language.

#include <iostream>

using namespace std;

//define function for swapping

void SwapValues(int* userVal1,int* userVal2){  

//set integer variable to store the value

int z = *userVal1;

//interchange their value

*userVal1 = *userVal2;  

//interchange their value

*userVal2 = z;

}

//define main method

int main()

{    

//declare variables

int x,y;

//get input from the user

cin>>x>>y;

//Call the method to swap the values

SwapValues(&x,&y);

//print their values

cout<<x<<" "<<y;

return 0;

}

<u>Output</u>:

3 8

8 3

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, we define required header file and function 'SwapValues()', pass two pointer type integer variables in argument that is 'userVal1' and 'userVal2'.
  • Set integer data type variable 'z' and initialize the value of 'userVal1' in it, then initialize the value of 'userVal2' in 'userVal1' and then initialize the value of 'z' in 'userVal2'.
  • Finally, define the main method in which we set two integer type variables and get input from the user in it then, call and pass those variables and print it.
6 0
3 years ago
Im lonnnelllly........................who want to date
blsea [12.9K]
Hey just a word of advice I hope you find someone lovely and someone who’ll enjoy you for you. Don’t look for people on apps like this I made many mistakes and it’s not smart. Have a good day. I get the feeling of loneliness and it sucks
8 0
2 years ago
Other questions:
  • Jannette has been experiencing slow performance on her computer. Today she received an error message saying that an update to he
    12·2 answers
  • Which option can Jesse use to customize her company’s logo, name, address, and similar details in all her business documents?
    7·1 answer
  • Blank includes websites that encourage interaction and connection among people businesses and organizations
    14·2 answers
  • Lexi wants to buy a $300 painting. when she gets to the store, she finds that it is on sale for 40% off. how much does Lexi spen
    10·1 answer
  • Write a program that reads a person's first and last names, separated by a space. Then the program outputs last name, comma, fir
    9·1 answer
  • A computer technician is responding to a call about a printer that is causing streaks to appear on every printout. Which of the
    5·1 answer
  • What is the principal goal of data science?<br>​
    5·1 answer
  • What will be displayed after this code segment is run?
    5·1 answer
  • Define a function FindLargestNum() with no parameters that reads integers from input until a negative integer is read. The funct
    9·1 answer
  • a cloud access security broker (casb) provides protection across 4 areas/pillars: visibility to detect all cloud services, data
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!