In this exercise you will debug the code which has been provided in the starter file. The code is intended to take two strings, s1 and s2 followed by a whole number, n, as inputs from the user, then print a string made up of the first n letters of s1 and the last n letters of s2. Your job is to fix the errors in the code so it performs as expected (see the sample run for an example).
Sample run
Enter first string
sausage
Enter second string
races
Enter number of letters from each word
3
sauces
Note: you are not expected to make your code work when n is bigger than the length of either string.
1 import java.util.Scanner;
2
3 public class 02_14_Activity_one {
4 public static void main(String[] args) {
5
6 Scanner scan = Scanner(System.in);
7
8 //Get first string
9 System.out.println("Enter first string");
10 String s1 = nextLine(); 1
11
12 //Get second string
13 System.out.println("Enter second string");
14 String s2 = Scanner.nextLine();
15
16 //Get number of letters to use from each string
17 System.out.println("Enter number of letters from each word");
18 String n = scan.nextLine();
19
20 //Print start of first string and end of second string
21 System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));
22
23
24 }

Answers

Answer 1

Answer:

Here is the corrected program:

import java.util.Scanner; //to accept input from user

public class 02_14_Activity_one { //class name

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

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

  System.out.println("Enter first string"); //prompts user to enter first string

          String s1 = scan.nextLine(); //reads input string from user

  System.out.println("Enter second string"); //prompts user to enter second string

          String s2 = scan.nextLine(); //reads second input string from user

    System.out.println("Enter number of letters from each word"); //enter n

          int n = scan.nextInt(); //reads value of integer n from user

          System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));

         } } //uses substring method to print a string made up of the first n letters of s1 and the last n letters of s2.

Explanation:

The errors were:

1.

Scanner scan = Scanner(System.in);

Here new keyword is missing to create object scan of Scanner class.

Corrected statement:

 Scanner scan = new Scanner(System.in);

2.

String s1 = nextLine();  

Here object scan is missing to call nextLine() method of class Scanner

Corrected statement:

String s1 = scan.nextLine();

3.

String s2 = Scanner.nextLine();

Here class is used instead of its object scan to access the method nextLine

Corrected statement:

String s2 = scan.nextLine();

4.

String n = scan.nextLine();

Here n is of type String but n is a whole number so it should be of type int. Also the method nextInt will be used to scan and accept an integer value

Corrected statement:

int n = scan.nextInt();

5.

System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));

This statement is also not correct

Corrected statement:

System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));

This works as follows:

s1.substring(0,n) uses substring method to return a new string that is a substring of this s1. The substring begins at the 0th index of s1 and extends to the character at index n.

s2.substring(s2.length() - n ) uses substring method to return a new string that is a substring of this s2. The substring then uses length() method to get the length of s2 and subtracts integer n from it and thus returns the last n characters of s2.

The screenshot of program along with its output is attached.

In This Exercise You Will Debug The Code Which Has Been Provided In The Starter File. The Code Is Intended

Related Questions

Define a function called sum, for a given an array and an int representing its size, if the size is at least 3, then sum up all elements whose indices are a multiple of 3 and return that value, otherwise, return 0.

Answers

Answer:

Written in C++

int sum(int arr[], int size) {

 int total = 0;      

 if(size>=3)  {

  for (int i = 0; i < size; ++i) {

     if(i%3 == 0)      {

     total += arr[i];    

     }

  }

 }

  return total;

}

Explanation:

This line defines the function

int sum(int arr[], int size) {

This line initializes sum to 0

 int total = 0;      

This line checks if size is at least 3

 if(size>=3)  {

This loop iterates through the array

  for (int i = 0; i < size; ++i) {

The following adds multiples of 3

     if(i%3 == 0)      {

     total += arr[i];    

     }

  }

 }

This returns the calculated sum

  return total;

}

See attachment for full program

Two of the computers at work suddenly can’t go online or print over the network. The computers may be trying to share the same IP address.

Which strategy is most likely to solve the problem?
rebooting the network server
reconfiguring the network hubs
installing network gateway hardware
logging off one of the computers, and then logging back o

Answers

Answer:

logging off one of the computers, and then logging back on

Answer:

the last one:

logging off one of the computers, and then logging back on

Explanation:

if something goes wrong on an electronic device you can reboot it and it should eventually work.

have a nice day

Research an organization that is using supercomputing, grid computing or both. Describe these uses and the advantages they offer. Are they a source of competitive advantage? Why or why not? Please be sure to include your reference(s).

Answers

Answer:

Procter and Gamble is an organization that uses supercomputing.

Explanation:

Supercomputing refers to the use of high-performance computers in the development and production of items. Procter and Gamble is a company known for the production of many household items and personal care products. Uses and advantages of supercomputing to this company include;

1. Testing virtual prototypes of substances used in production: This is a faster way of developing products that are sustainable because many prototypes can be examined with the help of computers and the best chosen for production.

2. Developing unique designs of products: Supercomputers allow for the development of high-quality designs which include the internal and external designs of products.

3. Simulation of many molecules: Molecules such as those involved in the production of surfactants can be analyzed to understand how they work with the aid of supercomputers.

4. Computational fluid dynamics: This helps the scientists to understand how fluid works using numerical analysis and the structure of compounds.

The designs and products obtained through supercomputing are a source of competitive advantage because the company can make high-quality and unique products that appeal to customers and meet the latest trends. This would increase their marketability and give them an advantage over companies that do not have access to these computers.

Reference:   The Department of Energy. (2009) High-Performance Computing Case Study. Procter & Gamble's Story of Suds, Soaps, Simulations, and Supercomputers

You've been hired by Maple Marvels to write a C++ console application that displays information about the number of leaves that fell in September, October, and November. Prompt for and get from the user three integer leaf counts, one for each month. If any value is less than zero, print an error message and do nothing else. The condition to test for negative values may be done with one compound condition. If all values are at least zero, calculate the total leaf drop, the average leaf drop per month, and the months with the highest and lowest drop counts. The conditions to test for high and low values may each be done with two compound conditions. Use formatted output manipulators (setw, left/right) to print the following rows:________.
September leaf drop
October leaf drop
November leaf drop
Total leaf drop
Average leaf drop per month
Month with highest leaf drop
Month with lowest leaf drop
And two columns:
A left-justified label.
A right-justified value.
Define constants for the number of months and column widths. Format all real numbers to three decimal places. The output should look like this for invalid and valid input:
Welcome to Maple Marvels
------------------------
Enter the leaf drop for September: 40
Enter the leaf drop for October: -100
Enter the leaf drop for November: 24
Error: all leaf counts must be at least zero.
End of Maple Marvels
Welcome to Maple Marvels
------------------------
Enter the leaf drop for September: 155
Enter the leaf drop for October: 290
Enter the leaf drop for November: 64
September leaf drop: 155
October leaf drop: 290
November leaf drop: 64
Total drop: 509
Average drop: 169.667
Highest drop: October
Lowest drop: November
End of Maple Marvels

Answers

Answer:

#include <iostream>

#iclude <iomanip>

#include <algorithm>

using namespace std;

int main(){

int num1, num2, num3,

int sum, maxDrop, minDrop = 0;

float avg;

string end = "\n";

cout << " Enter the leaf drop for September: ";

cin >> num1 >> endl = end;

cout << "Enter the leaf drop for October: ";

cin >> num2 >> endl = end;

cout << "Enter the leaf drop for November: ";

cin >> num3 >> endl = end;

int numbers[3] = {num1, num2, num3} ;

string month[3] = { "September", "October", "November"}

for ( int i =0; i < 3; i++) {

 if (numbers[i] < 0) {

   cout << "Error: all leaf counts must be at least zero\n";

   cout << "End of Maple Marvels\n";

   cout << "Welcome to Maple Marvels";

   break;

 } else if (number[i] >= 0 ) {

     sum += number[i] ;

   }

}

for (int i = 0; i < 3; i++){

 cout << month[i] << " leaf drop: " << numbers[i] << endl = end;

}

cout << "Total drop: " << sum << endl = end;

cout << setprecision(3) << fixed;

cout << "Average drop: " << sum / 3<< endl = end;

maxDrop = max( num1, num2, num3);

minDrop = min(num1, num2, num3);

int n = sizeof(numbers)/sizeof(numbers[0]);

auto itr = find(number, number + n, maxDrop);

cout << "Highest drop: "<< month[ distance(numbers, itr) ] << endl = end;

auto itr1 = find(number, number + n, minDrop);

cout << "Lowest drop: " << month[ distance(numbers, itr1) ] << endl = end;

cout << "End of Maple Marvels";

Explanation:

The C++ soucre code above receives three integer user input and calculates the total number, average, minimum and maximum number of leaf drop per month, if the input isn't less than zero.

Who plays Breath of the Wild?

Answers

Answer:

me

Explanation:

yea not me

Explanation:

Thomas has decided to key an agenda for the FBLA meeting using a column format. What is recommended to guide the reader’s eye and control the left to right flow or text?

Answers

Incomplete question. The full question reads;

Q. Thomas has decided to key an agenda for the FBLA meeting using a column format. What is recommended to guide the reader's eye and control the left-to-right flow of text?

Answer choices:

table featuredot leader tableft alignment tooldouble space

Answer:

dot leader tab

Explanation:

Indeed, Thomas could use the dot leader tab on MS word to guide the reader's eye and control the left-to-right flow of the text so the reader can note the agenda.

For example, below is a typical way the dot leader tab would look like on a document:

............... Agenda 1

............... Agenda 2

............... Agenda 3

I prefer a job where I am praise for good performance or I am accountable for results

Answers

Answer:

What?

Explanation:

Write a function addUpSquaresAndCubes that adds up the squares and adds up the cubes of integers from 1 to N, where N is entered by the user. This function should return two values - the sum of the squares and the sum of the cubes. Use just one loop that generates the integers and accumulates the sum of squares and the sum of cubes. Then, write two separate functions sumOfSquares and sumOfCubes to calculate and return the sums of the squares and sum of the cubes using the explicit formula below.

Answers

Answer:

All functions were written in python

addUpSquaresAndCubes Function

def addUpSquaresAndCubes(N):

    squares = 0

    cubes = 0

    for i in range(1, N+1):

         squares = squares + i**2

         cubes = cubes + i**3

    return(squares, cubes)

sumOfSquares Function

def sumOfSquares(N):

    squares = 0

    for i in range(1, N+1):

         squares = squares + i**2

    return squares

sumOfCubes Function

def sumOfCubes(N):

    cubes = 0

    for i in range(1, N+1):

         cubes = cubes + i**3

    return cubes

Explanation:

Explaining the addUpSquaresAndCubes Function

This line defines the function

def addUpSquaresAndCubes(N):

The next two lines initializes squares and cubes to 0

    squares = 0

    cubes = 0

The following iteration adds up the squares and cubes from 1 to user input

    for i in range(1, N+1):

         squares = squares + i**2

         cubes = cubes + i**3

This line returns the calculated squares and cubes

    return(squares, cubes)

The functions sumOfSquares and sumOfCubes are extract of the addUpSquaresAndCubes.

Hence, the same explanation (above) applies to both functions

Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two individual for a particular year is exactly the same, you should print an error and make the user enter both the salaries again for that year. (The condition is that there salaries should not be the exact same).Your program should accept from the user the salaries for each individual one year at a time. When the user is finished entering the salaries, the program should print which individual made the highest total salary over the 5 year period. This is the individual whose salary is the highest.You have to use arrays and loops in this assignment.In the sample output examples, what the user entered is shownin italics.Welcome to the winning card program.
Enter the salary individual 1 got in year 1>10000
Enter the salary individual 2 got in year 1 >50000
Enter the salary individual 1 got in year 2 >30000
Enter the salary individual 2 got in year 2 >50000
Enter the salary individual 1 got in year 3>35000
Enter the salary individual 2 got in year 3 >105000
Enter the salary individual 1 got in year 4>85000
Enter the salary individual 2 got in year 4 >68000
Enter the salary individual 1 got in year 5>75000
Enter the salary individual 2 got in year 5 >100000
Individual 2 has the highest salary

Answers

In python:

i = 1

lst1 = ([])

lst2 = ([])

while i <= 5:

   person1 = int(input("Enter the salary individual 1 got in year {}".format(i)))

   person2 = int(input("Enter the salary individual 1 got in year {}".format(i)))

   lst1.append(person1)

   lst2.append(person2)

   i += 1

if sum(lst1) > sum(lst2):

   print("Individual 1 has the highest salary")

else:

   print("Individual 2 has the highest salary")

This works correctly if the two individuals do not end up with the same salary overall.

Sukhi needs to insert a container into her form to collect a particular type of information.

Which object should she insert?

Answers

Answer:

text box

Explanation:

on edge 2020

Answer:

A- text box

Explanation: ;)

When you check to see how much RAM, or temporary storage you have available, you are checking your _____.

primary memory

secondary storage

secondary memory

tertiary storage

Answers

When you check to see how much RAM, or temporary storage you have available, you are checking your primary memory.

The correct option is first.

What is drive?

Drive provides a storage space and speed for processing the data in the drive on the personal computers or laptops at low cost.

RAM, also known as Random Access Memory, is storage drive which is temporary but primary.

So, RAM is considered as primary memory.

Thus, when you check to see how much RAM, or temporary storage you have available, you are checking your primary memory.

Learn more about drive.

https://brainly.com/question/10677358

#SPJ2

Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both single words. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya

Answers

Answer:

Written in Python:

import re

name = input("Name: ")

print(re.sub("[ ]", ", ", name))

Explanation:

This line imports the regular expression library

import re

This line prompts user for input

name = input("Name: ")

This line replace the space with comma and prints the output

print(re.sub("[ ]", ", ", name))

PLEASE help me I will really appreciate it​

Answers

D)high speed data link
F)DSL
B)T3 line
C) T1 line
G) IPV4
I) lan connection
A) network
H) HTTP
J) domain name and structure
E) cable

Which of the following may be stored in an
e-mail address book? Check all of the boxes that
apply.
names
e-mail addresses
physical addresses
subjects of e-mails
fax numbers

Answers

Answer:

names, email addresses, subjects of e-mails

Explanation:

Answer:

names

e-mail addresses

physical addresses

fax numbers

Explanation:

correct answers

The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values are interpreted as representing the lengths of the sides of a triangle. The program prints a message that states whether the triangle is scalene, isosceles, or equilateral. Develop a set of test cases (at least 6 ) that you feel will adequately test this program. (This is a classic testing problem and you could find numerous explanations about it on the internet. I would recommend that you try to submit your own answer, based on your understanding of the topic)
Let’s define what the three different types of triangle requirements for the side’s lengths are:______.

Answers

Answer:

Here is the Python program:

def MyersTriangle(a, b, c):  #method to test triangles

     

    if not(isinstance(a, int) and isinstance(b, int) and isinstance(c, int)):  #checks if values are of type int

         return 'Enter integer values'  

         

    elif a==0 or b==0 or c==0: #checks if any value is equal to 0

         return 'Enter integer values greater than 0'

         

    elif a<0 or b<0 or c <0:  #checks if any value is less than 0

         return 'All values must be positive'

         

    elif not (a+b>=c and b+c>=a and c+a>=b):  #checks if triangle is valid

         return 'Not a valid triangle'

         

    elif a == b == c:  #checks if triangle is equilateral

         return 'triangle is equilateral'

         

    elif a == b or b == c:  #checks if triangle is isoceles

         return 'triangle is isoceles'

         

    elif a != b and a != c and b != c:  #checks if triangle is scalene

         return 'triangle is scalene'        

#test cases

print(MyersTriangle(2.4,7.5,8.7))  

print(MyersTriangle(0,0,0))

print(MyersTriangle(-1,5,4))

print(MyersTriangle(10,10,25))

print(MyersTriangle(5,5,5))

print(MyersTriangle(3,3,4))

print(MyersTriangle(3,4,5))

   

Explanation:

The program uses if elif conditions to check:

if the values are integers: this is checked by using isinstance method that checks if values belongs to a particular int. If this returns true then values are integers otherwise not

if values are not 0: this is checked by using logical operator or between each variable which checks if any of the values is 0

if values are not negative: This is checked by using relational operator < which means the values are less than 0

if values make a valid triangle: this is checked by the rule that the sum of two sided of the triangle is greater than or equal to the third side.

and then checks if the triangle is scalene, isosceles, or equilateral: This is checked by the following rules:

For scalene all three sides are unequal in length

For isosceles any of the two sides are equal in length

For equilateral all sides should be equal in length.

The screenshot of the program along with the output is attached.

True or False: Wikipedia is a reliable source. ​

Answers

false,
it's not a reliable source

Answer:

Answers are given by the users, so reliable information varies. Usually, you can find if it is reliable by checking other websites to see if the information matches up with other reliable websites.

Explanation:

For an alternative to the String class, and so that you can change a String's contents, you can use_________ .
a. char.
b. StringHolder.
c. StringBuilder.
d. StringMerger.

Answers

Answer:

c. StringBuilder

Explanation:

An alternative to the String class would be the StringBuilder Class. This class uses Strings as objects and allows you to mix and match different strings as well as adding, removing, implementing,  and modifying strings themselves as though they were similar to an array. Unlike the string class StringBuilder allows you to modify and work with a combination of strings in the same piece of data as opposed to having various objects and copying pieces which would take up more memory.

1. What is a technological system?*
A.a system that takes an input, changes it according to the system's use, and then
produces an output output
B.a system that takes an output, changes it according to the system's use, and then
produces an input
C.a system that starts with a process, then output resources in the input

Answers

Answer:

c.a system that start with a process, them output resources in the input

Which of the following is often accessed in a browser but is not itself a browser feature or tool?
O history
add-ons
O bookmarks
webmail

Answers

Answer:

Webmail

Explanation:

Got it right on a test

When investigators find evidentiary items that aren't specified in a warrant or under probable cause what type of doctrine applies

Answers

search it up and it’ll tell you what doctrines it applies too

Define a Python function named matches that has two parameters. Both parameters will be lists of ints. Both lists will have the same length. Your function should use the accumulator pattern to return a newly created list. For each index, check if the lists' entries at that index are equivalent. If the entries are equivalent, append the literal True to your accumulator. Otherwise, append the literal False to your accumulator.

Answers

Answer:

The function in Python is as follows:

def match(f1,f2):

    f3 = []

    for i in range(0,len(f1)):

         if f1[i] == f2[i]:

              f3.append("True")

         else:

         f3.append("False")

    print(f3)

Explanation:

This line defines the function

def match(f1,f2):

This line creates an empty list

    f3 = []

This line is a loop that iterates through the lists f1 and f2

    for i in range(0,len(f1)):

The following if statement checks if corresponding elements of both lists are the same

         if f1[i] == f2[i]:

              f3.append("True")

If otherwise, this is executed

         else:

         f3.append("False")

This prints the newly generated list

    print(f3)

Is main memory fast or slow?

Answers

Answer:

Slower

Explanation:

PLEASE HELP WILL GIVE BRAINLIEST IM ALREADY FAILING IN THIS CLASS LOL < 3

Answers

Answer: Did you ever think of a mirror?

Explanation: Not trying to be rude about it.

Write a program called DeliveryCharges for the package delivery service in Exercise 4. The program should again use an array that holds the 10 zip codes of areas to which the company makes deliveries. Create a parallel array containing 10 delivery charges that differ for each zip code. Prompt a user to enter a zip code, and then display either a message indicating the price of delivery to that zip code or a message indicating that the company does not deliver to the requested zip code.

Answers

Answer:

zip_codes = ["11111", "22222", "33333", "44444", "55555", "66666", "77777", "88888", "99999", "00000"]

charges = [3.2, 4, 1.95, 5.7, 4.3, 2.5, 3.8, 5.1, 6.6, 7.3]

deliver = False

index = -1

zip_code = input("Enter the zip code: ")

for i in range(len(zip_codes)):

   if zip_code == zip_codes[i]:

       deliver = True

       index = i

       break

if deliver:

       print("The charge of delivery to " + zip_codes[index] + " is $" + str(charges[index]))

else:

   print("There is no delivery to " + zip_code)

Explanation:

*The code is in Python.

Initialize the zip_codes array with 10 zip codes

Initialize the charges array with 10 corresponding values

Initialize the deliver as False, this will be used to check if the zip code is in the zip_codes

Initialize the index, this will be used if the zip code is a valid one, we will store its index

Ask the user to enter the zip_code

Create a for loop that iterates the length of the zip_codes array. Inside the loop:

Check if the zip_code is equal to the any of the items in the zip_codes. If it is, set the deliver as True, set the index as i, and break

When the loop is done, check the deliver. If it is True, then print the charge of the delivery. Otherwise, print that there is no delivery to that zip code

The state way of grading drivers is called what?

*

Answers

Oh yeah I forgot what you did you do that I mean yeah I forgot to tell you something about you lol lol I don’t want to see it anymore

MULTIPLE CHOICE If you are completing your math homework on a desktop in the computer lab at school, the software is


A Single use
B Locally installed
С On a network
D utility​

Answers

Answer:

Single use i think

Explanation:

Answer: im pretty sure on a network.

Explanation:

Write a function to receive any word as input, search the song titles only and return the number of top billboard songs that contain that word. Your function should meet the following requirements: Your function should receive any word or phrase as an input string and return a simple message with the number of songs that contain those words. E.g. [5] songs were found to contain [supplied phrase] in this dataset If the words or phrase supplied were not found in the database, return the message No songs were found to contain the words: [supplied phrase] Remember to deal with whatever letter case you are supplied i.e. all caps or all lowercase, etc. Test your function with the word like and confirm that your result reads [100] songs were found to contain [like] in this dataset

Answers

Answer:

Here is the function:

def NumberOfSongs(word):  # function definition    

   count=0  #count the occurrence of word in song

   for song in lyrics['Lyrics']:  #iterates through song lyrics

       if word in str(song):  #if word is in the song

           count=count+1  #adds 1 to the count

   if count!=0:  #if word occurs in the songs

       return f'{str(count)} songs were found to contain {word} in this dataset'  #display the count of the word in the song

   else:  #if word does not appear in any song

       return f'No songs were found to contain the words:{word}'  #returns this message if no songs were found with given word

print(NumberOfSongs('like')) #calls method with the word like given as parameter to it

Explanation:

You can add the csv file this way:

import pandas as pd

lyrics = pd.read_csv("lyrics.csv", encoding="cp1252")

Now you can use the NumberOfSongs method which iterates through the Lyrics of lyrics.csv and find if any of the songs in the file contains the specified word.

The screenshot of program along with its output is attached. Since the file was not provided i have created a csv file. You can add your own file instead of lyrics.csv

Shortest Remaining Time First is the best preemptive scheduling algorithm that can be implemented in an Operating System.

a. True
b. False

Answers

Answer:

a

Explanation:

Yes, true.

Shortest Remaining Time First, also popularly referred to by the acronym SRTF, is a type of scheduling algorithm, used in operating systems. Other times it's not called by its name nor its acronym, it is called the preemptive version of SJF scheduling algorithm. The SJF scheduling algorithm is another type of scheduling algorithm.

The Shortest Remaining Time First has been touted by many to be faster than the SJF

The answer to the question which asks if the Shortest Remaining Time First is the best preemptive scheduling algorithm that can be implemented in an Operating System is:

True

What is Shortest Remaining Time First?

This refers to the type of scheduling algorithm which is used to schedule tasks that would be executed in the processing unit in an Operating System based on the shortest time taken to execute the task.

With this in mind, we can see that this is the best preemptive scheduling algorithm that can be implemented in an Operating System because it makes task execution faster.

Read more about scheduling algorithm here:
https://brainly.com/question/15191620

Read the scenario below, and then answer the question.
Dan is trying to decide on what his major should be in college, so he chooses to take a personality
test.
What can Dan expect to learn from this test?
A. the weaknesses he can address and the strengths he has

B. the academic areas he
might have natural talent and ability in

C. which methods of solving problems and interacting with others he favors

D. what his favorite hobbies and interests are

Answers

the answer is:

c. which methods of solving problems and interacting with others he favors.

Answer:

C

Explanation:

Write a program that finds the number of items above the average of all items. The problem is to read 100 numbers, get the average of these numbers, and find the number of the items greater than the average. To be flexible for handling any number of input, we will let the user enter the number of input, rather than fixing it to 100.

Answers

Answer:

Written in Python

num = int(input("Items: "))

myitems = []

total = 0

for i in range(0, num):

     item = int(input("Number: "))

     myitems.append(item)

     total = total + item

average = total/num

print("Average: "+str(average))

count = 0

for i in range(0,num):

     if myitems[i] > average:

           count = count+1

print("There are "+str(count)+" items greater than average")

Explanation:

This prompts user for number of items

num = int(input("Items: "))

This creates an empty list

myitems = []

This initializes total to 0

total = 0

The following iteration gets user input for each item and also calculates the total

for i in range(0, num):

     item = int(input("Number: "))

     myitems.append(item)

     total = total + item

This calculates the average

average = total/num

This prints the average

print("Average: "+str(average))

This initializes count to 0

count = 0

The following iteration counts items greater than average

for i in range(0,num):

     if myitems[i] > average:

           count = count+1

This prints the count of items greater than average

print("There are "+str(count)+" items greater than average")

Other Questions
True or false: This is for science and I only have one more question but it's getting me stuck: if you get this right I'll vote you brainiest!:) If a gene sequence changes, the proteins associated with that gene could likewise be affected. True/False 6u-2u+4 simplified please What is the slope of the line that passes through the points (4, 9) and (1, 6)? Is saying the beautiful are the ones who help people gramatically correct? Which choice best revises the sentence with preciselanguage?O William Blake is one of the best of all time.O That writer is historically one of the best ones to havewritten.O F. Scott Fitzgerald is a famous 20th-century author.O That writer is better than any other 20th-centuryauthor. The Dutch settled ina. New Englandb. Virginiac. Louisianad. New Netherland URGENT PLEASE I BEG OF U PLEASE HELP ME PLEASEPLZ HELP AND THANK YOU, DONT copy of internet it goes on my gradeHow do you identify a symbol in writing? Why was calligraphy important in Islamic culture?A. It was used to write short stories B. It was used in art instead of imagesC. It was a way to record medical information D. It was a way to translate works of literature (PLEASE HURRY ITS TIMED) What is the measureof ZA, in degrees?20 How does the formal amendment process illustrate the goalsof the Framers? What requirements of the formal amendment processsupport your answers Your parents will retire in 27 years. They currently have $280,000 saved, and they think they will need $1,900,000 at retirement. What annual interest rate must they earn to reach their goal, assuming they don't save any additional funds? Round your answer to two decimal places. Please help me I dont get this b. Water has a specific heat of 4.184 J/gC. If the temperature of 250 g ofwater changes from 22.9C to 14.7C, how much heat energy was removedfrom the water? -5--5--5 -5what is the domain ? A+realistic+painting+of+a+man+on+horseback ill make you brainlisted In what kind of aquatic ecosystems do we have invasive species? | Use the sentence to complete the activity.The scientists were right about the time the algae bloom would take place.Rewrite this sentence using more precise technical language. We must do something to help the bee population win the battle against a colony collapse or the world faces horrendous consequences. Bees are important to our food chain. The loss of bees would mean the extinction of food as we know it.What is the purpose of this passage? what is chapter 10 about in the outsiders???? Here is the equation of four straight lines. Two of these lines are parallel. Which twolines? (3)Line A y = 2x+3Line B 2y = 6- 3xLine C 4x -2y =3Line D y = 3-2x