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
VashaNatasha [74]
3 years ago
9

Consider the following code example:

Computers and Technology
1 answer:
yKpoI14uk [10]3 years ago
7 0

Answer:

The number of invoices for each vendor that have a larger balance due than the average balance due for all invoices.

Explanation:

This part of the code below

WHERE InvoiceTotal - PaymentTotal - CreditTotal >

(SELECT AVG (InvoiceTotal - PaymentTotal- CreditTotal)

FROM Invoices)

gives the condition to pick the invoices with balance that are greater than the average balance for all invoice.

This part of the code below

GROUP BY VendorName

ORDER BY BalanceDue DESC;

then enables the program to group the result of the above condition by VendorName and sort the resulting rows in the order of BalanceDue. You will therefore, obtain for each row in the NumberOfInvoices column, the number of invoices for each vendor that have a larger balance due than the average balance due for all invoices.

You might be interested in
PLZ HELP!!! I'm a beginner in coding!
Lina20 [59]

import random

rock,paper,scissors = 1,2,3

choice = int(input("Please choose 1 2 or 3: "))

computer = random.randint(1,3)

player_won = False

draw = False

if choice == computer:

   draw = True

elif choice == 1 and computer == 3:

   player_won = True

elif choice == 2 and computer == 1:

   player_won = True

elif choice == 3 and computer == 2:

   player_won = True

if player_won:

   print("You won!")

elif not player_won and not draw:

   print("The computer won!")

else:

   print("It's a draw!")

First, I recommend importing at the beginning of your program. Also, you can combine all your same datatype variables in one line. You also need to cast your user choice to an integer so you can compare it with the computer's choice. I wrote the if, elif, and else statements using a boolean variable. I simply wrote all the possibilities that would result in the player winning and this would result in the player_won variable being true. If this is the case, we print to the console, "You won!"

4 0
3 years ago
Write a program that asks the user to enter a series of numbers separated by commas. Here is an example of valid input: 7,9,10,2
alex41 [277]

Answer:

Here is the JAVA program. Let me know if you need the program in some other programming language.

import java.util.Scanner; // used for taking input from user

public class Main{ //Main class

public static void main(String[] args) {//start of main() function body

  Scanner scan = new Scanner(System.in); // creates a Scanner type object

   String input; // stores input series

    int sum = 0; //stores the sum of the series

    System.out.println("Enter a series of numbers separated by commas: "); //prompts user to enter a series of numbers separated by comma

     input = scan.nextLine(); //reads entire input series

     String[] numbers = input.split("[, ]"); //breaks the input series based on delimiter i.e. comma and stores the split sub strings (numbers) into the numbers array

   for (int i = 0; i < numbers.length; i++) { //loops through each element of numbers array until the length of the numbers reaches

          sum += Integer.parseInt(numbers[i]); } // parses the each String element of numbers array as a signed decimal integer object and takes the sum of all the integer objects

     System.out.println("Sum of all the numbers: " + sum);  } } //displays the sum of all the numbers

Explanation:

The program prompts the user to enter a series separated by commas.

Then split() method is used to split or break the series of numbers which are in String form, into sub strings based on comma (,) . This means the series is split into separate numbers. These are stored in numbers[] array.

Next the for loop iterate through each sub string i.e. each number of the series, converts each String type decimal number to integer using Integer.parseInt and computes the sum of all these integers. The last print statement displays the sum of all numbers in series.  

If the input is 7,9,10,2,18,6

Then the output is: 7+9+10+2+18+6

sum = 52

The program and its output is attached.

8 0
3 years ago
Why does Brainly say, "We're sorry, but we are not able to complete your registration at this time?" Please tell me, because I r
Rus_ich [418]

just change your age to 13 or above-

6 0
3 years ago
Non-Discretionary Items will increase or decrease without any action by Congress or the President. Which of the following is NOT
Alex_Xolod [135]
<span>A. Military Spending</span>
7 0
4 years ago
When you send an echo request message with the ping program, a successful attempt will return a(n) ______ message.
svlad2 [7]

Answer:

echo reply

Explanation:

It is a test that a user performs to confirm that remote system is up and running on the network. This is needed when basic connectivity failure problem appears. Internet Control Message Protocol  renders 2 messages for this service which are Echo Request and Echo Reply. Echo Request is a request sent to a destination device. This system acknowledges with an Echo Reply message. Echo request is generated by destination system with PING program. Ping program is used for testing basic connectivity. An echo reply is sent by target system to the requesting system acknowledging that the echo request has been received.

3 0
3 years ago
Other questions:
  • OBJECTIVE This project will familiarize you with the use of pthreads, pthread mutexes and pthread condition variables. Your prog
    9·1 answer
  • Which method of deleting files can be used in windows xp and vista?
    12·1 answer
  • In the Dread Pirate Roberts case, U.S. Ulbricht, 31 F. Supp. 3D 54D (S.D.N.Y. 2014), one of the issues that the court addressed
    10·1 answer
  • Select the correct answer
    11·2 answers
  • Irena sends unwanted e-mails to another girl in her class, but she is reported to the principal. Irena stops sending the e-mails
    12·2 answers
  • The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication li
    8·1 answer
  • Where will the append() function add a new element to a list? A. At the end of the list B. At the beginning of the list C. In th
    10·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    7·2 answers
  • I need help ASP 3rd grade math ​
    11·2 answers
  • How do i copy a canvas course from old class to new course.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!