Questions
23.2 PROJECT 2 : Data Visualization using LOOPS (python) This program will display a set of...

23.2 PROJECT 2 : Data Visualization using LOOPS (python)

This program will display a set of authors and the number of novels written by each author in both a table and a histogram. You will ask the user for all of the information. Using what you learned about incremental development, use the following approach to create your program:

  1. Prompt the user for the information about the table. First, ask for the title of this data set by prompting the user for a title for data. Output the title.

    Ex:
Enter a title for the data:
Number of Novels Authored
You entered: Number of Novels Authored
  1. The table will have two columns; one for the authors and one for the number of novels. Prompt the user for the headers of two columns of the table. Output the column headers.

    Ex:
Enter the column 1 header:
Author name
You entered: Author name

Enter the column 2 header:
Number of novels
You entered: Number of novels
  1. Prompt the user for data points. Data points must be in this format: string, int, representing the author and the number of novels written by the author. Store the information before the comma into a string variable and the information after the comma into an integer. The user will enter -1 when they have finished entering data points. Output the data points. Store the string components of the data points in a list of strings. Store the integer components of the data points in a list of integers.

    Ex:
Enter a data point (-1 to stop input):
Jane Austen, 6
Author: Jane Austen
Number of Novel(s): 6
  1. Perform error checking for the data point entries as follows:
  • If entry has no comma and is not -1
  • Output: Error: No comma in string.

If the error occurs, output the appropriate error message and prompt again for a valid data point. You can assume that if a comma is present, then the data point is entered correctly.
Ex:

Enter a data point (-1 to stop input):
Ernest Hemingway 9
Error: No comma in string.

Enter a data point (-1 to stop input):
Ernest Hemingway, 9
Author: Ernest Hemingway
Number of Novel(s): 9
  1. Output the information in a formatted table. The title is right justified with a minimum field width value of 33. Column 1 has a minimum field width value of 20. Column 2 has a minimum field width value of 23.

    Ex:
        Number of Novels Authored
Author name         |       Number of novels
--------------------------------------------
Jane Austen         |                      6
Charles Dickens     |                     20
Ernest Hemingway    |                      9
Jack Kerouac        |                     22
F. Scott Fitzgerald |                      8
Mary Shelley        |                      7
Charlotte Bronte    |                      5
Mark Twain          |                     11
Agatha Christie     |                     73
Ian Flemming        |                     14
J.K. Rowling        |                     14
Stephen King        |                     54
Oscar Wilde         |                      1
  1. Output the information as a formatted histogram. Each name is right justified with a minimum field width value of 20.

    Ex:
         Jane Austen ******
     Charles Dickens ********************
    Ernest Hemingway *********
        Jack Kerouac **********************
 F. Scott Fitzgerald ********
        Mary Shelley *******
    Charlotte Bronte *****
          Mark Twain ***********
     Agatha Christie *************************************************************************
        Ian Flemming **************
        J.K. Rowling **************
        Stephen King ******************************************************
         Oscar Wilde *

For this project, you can assume that the user will not enter duplicate author names.

In: Computer Science

Given the code snippet below, complete this program by: Displaying the data (temperatures) Displaying the minimum...

Given the code snippet below, complete this program by:

  1. Displaying the data (temperatures)
  2. Displaying the minimum temperature value
  3. Displaying the maximum temperature value
  4. Displaying the mean temperature

SUBMIT THE PYTHON FILE (.PY) NOT SCREENSHOT, WORD DOCUMENT ETC. IF YOUR SUBMISSION IS NOT A .PY FILE, AUTOMATIC ZERO.

#Code snippet below. Copy this into your favorite IDE and complete the tasks

import numpy as np

import pandas as pd

temps = np.random.randint(60, 101, 6)

temperatures = pd.Series(temps)

2.

Write a python program that asks the user to enter

a number of quarters, dimes, nickels and pennies and then outputs the monetary value of the coins in the format of

dollars and remaining cents. YOUR PROGRAM MUST HAVE AT LEAST ONE FUNCTION.

3.

USE THE python TextBlob library to create a language translation application. Your application should accept at least two input from the user. The first input should be the text to be translated (your program should accept any language). The second should be the language to translate to. At minimum, your program should be able to translate to 10 different languages.

Your program must have at least one python function.

In: Computer Science

Use Python to Load a file containing a list of words as a python list :param...

Use Python to Load a file containing a list of words as a python list
:param str filename: path/name to file to load
:rtype: list

In: Computer Science

In java For faster sorting of letters, the U.S. Postal Service encourages companies that send large...

In java

For faster sorting of letters, the U.S. Postal Service encourages companies that send large volumes of mail to use a bar code denoting the ZIP code (see below).

The encoding scheme for a five-digit ZIP code is shown below There are full-height frame bars on each side. The five encoded digits are followed by a check digit, which is computed as follows: Add up all digits, and choose the check digit to make the sum a multiple of 10. For example, the sum of the digits in the ZIP code 95014 is 19, so the check digit is 1 to make the sum equal to 20.

Each digit of the ZIP code, and the check digit, is encoded according to the table below, where 0 denotes a half bar and 1 a full bar. Note that they represent all combinations of two full and three half bars. The digit can be computed easily from the bar code using the column weights 7, 4, 2, 1, 0. For example, 01100 is

0 × 7 + 1 × 4 + 1 × 2 + 0 × 1 + 0 × 0 = 6

The only exception is 0, which would yield 11 according to the weight formula - to represent the barcode , you can use the table below also.
Weight Digit 74210
1. 00011

2. 00101

3. 00110

4. 01001

5. 01010

6. 01100

7. 10001

8. 10010

9. 10100

0. 11000

Write a program that asks the user (a) for a ZIP code and prints the bar code. (b) for a barcode and prints the ZIP code. Use classes to implement this solution.

Use : for half bars, | for full bars. For example, 95014 becomes

||:|:::|:|:||::::::||:|::|:::|||
You can learn more about zip code encoding here: https://en.wikipedia.org/wiki/POSTNET

In: Computer Science

(Java Problem) Create a Produce class that have an instance variable of type String for the...

(Java Problem)

Create a Produce class that have an instance variable of type String for the

name, appropriate constructors, appropriate accessor and mutator methods,

and a public toString() method. Then create a Fruit and a Vegetable class

that are derived from Produce. These classes should have constructors that

take the name as a String, the price (this is the price per box) as a double,

the quantity as an integer, and invoke the appropriate constructor from the

base class to set the name. Also, they should override toString method to

display the name of the produce, the price, and its type. For instance, Mango

is a Fruit and Cauliflower is a Vegetable.

Finally, create a class called TruckOfProduce that will keep track of the boxes

of Vegetables and Fruits added in to the truck. This class should use an array

of Produce to store both vegetables and fruits. Also, it should have the

following:

Constructor

that accepts an integer

to initialize the array of Produce

addProduce

method that

adds either fruit or vegetable

to the array

search

method that accepts

a name string

, which can be either the

name of a fruit or vegetable, and returns true if the name exists.

Otherwise, it returns false.

remove

method that accepts

a produce object

and returns true if the

produce is found and removed successfully. Otherwise, it returns false.

computeTotal

method that will return the total cost of all the produce

in the truck.

toString

method that returns all the produce from in the truck.

In: Computer Science

prove the worst case of quick sort using subsetution, what is T(n) of quick sort and...

prove the worst case of quick sort using subsetution, what is T(n) of quick sort and what is the worst case for it

In: Computer Science

What do you think about adding a project buffer for the entire project, as critical chain...

What do you think about adding a project buffer for the entire project, as critical chain scheduling suggests?

What are some ethical considerations when using slack and buffers?

In: Computer Science

Write by hand a full java program that will prompt the user for the length and...

Write by hand a full java program that will prompt the user for the length and width of a square, calculate and display the area of that square rounded to the nearest tenth with an appropriate message.

In: Computer Science

This assignment tests your understanding of abstract classes, inheritance, and requirements modeling using class-based methods. The...

This assignment tests your understanding of abstract classes, inheritance, and requirements modeling using class-based methods. The assignment scenario involves an abstract vehicle class and concrete subclasses Jeep and Ford. The vehicle class has the following variables (manufacturer, language), and methods (getManufacturer( ), and getLanguage( )). The manufacturer builds a specific vehicle (a Jeep and a Ford). The manufacturer will notify the consumer class that a Jeep and a Ford are available for purchase. The consumer class purchases the Jeep. Your

Tasks:

a) Draw a Use Case diagram based on the above scenario

b) Draw a UML Class diagram based on the above scenario

In: Computer Science

C++ Write a program with the following elements: in main() -opens the 2 files provided for...

C++

Write a program with the following elements:

in main()

-opens the 2 files provided for input (Lab_HW9_2Merge1.txt and Lab_HW9_2Merge2.txt)

-calls a global function to determine how many lines are in each file

-creates 2 arrays of the proper size

-calls a global function to read the file and populate the array (call this function twice, once for each file/array)

-calls a global function to write out the 'merged' results of the 2 arrays

*if there are multiple entries for a person, these should be merged and should appear as a single entry in the resulting file

*resulting file should be named 'merged_output.txt'

program should check to see if a name is already present in one file or another. If the name is present in both files display the name once in the merged file and add the numbers.

Example:

1st File:

Carlos 7

Tina 3

2nd File:

Lena 2

Carlos 3

Merged File:

Carlos 10

Tina 3

Lena 2

In: Computer Science

explain state laws that protect data. What is the problem due to no one comprehensive federal...

explain state laws that protect data. What is the problem due to no one comprehensive federal data privacy or security law.

In: Computer Science

Number Analysis Program (Specific Design Specifications) Design a Python program that asks the user to enter...

Number Analysis Program (Specific Design Specifications)

Design a Python program that asks the user to enter a series of 20 numbers. The program should store the numbers in a list then display the following data: The lowest number in the list The highest number in the list The total of the numbers in the list The average of the numbers in the list

This python program must include the following functions. Your program must use the exact names, parameter lists, and follow the function descriptions provided.

def CreateNumberList(howMany): This function will accept a parameter for how many numbers to include in a list. It will create a list containing howMany elements that are random numbers in the range 1 - 500. The function return value will be the list that contains these values.

def SortList(myList): This function will accept the list of random numbers as the parameter variable. It will first use the sort() function to sort the values in the list. Then this function will use index 0 and index len(myList) - 1 to print the smallest and largest value in the list. This function does not have a return value.

def DisplayAverage(myList): This function will accept the list of random numbers as the parameter variable. If will use a for loop to iterate through each item in the list and add each value to a sum variable. You will then calculate the average of the values and display the average as the output. This function does not have a return value.

def main(): This function will begin by asking the user how many numbers they want to generate in their list. You must include an input validation loop that will not accept a number less than 1. After the input is validated, call the CreateNumberList function and store the return value in a variable, then call the SortList and DisplayAverage functions passing your list as an argument. Call your main function to execute the program.

In: Computer Science

C++ Write a program with the following elements: in main() -opens the 2 files provided for...

C++

Write a program with the following elements:

in main()

-opens the 2 files provided for input (Lab_HW9_2Merge1.txt and Lab_HW9_2Merge2.txt)

-calls a global function to determine how many lines are in each file

-creates 2 arrays of the proper size

-calls a global function to read the file and populate the array (call this function twice, once for each file/array)

-calls a global function to write out the 'merged' results of the 2 arrays

*if there are multiple entries for a person, these should be merged and should appear as a single entry in the resulting file

*resulting file should be named 'merged_output.txt'

program should check to see if a name is already present in one file or another. If the name is present in both files display the name once in the merged file and add the numbers.

Example:

1st File:

Carlos 7

Tina 3

2nd File:

Lena 2

Carlos 3

Merged File:

Carlos 10

Tina 3

Lena 2

In: Computer Science

Illustrate the operation of Heap Sort on the array A=[5,14,3,23,8,18,23,9,11]

Illustrate the operation of Heap Sort on the array A=[5,14,3,23,8,18,23,9,11]

In: Computer Science

C++ Write a program with the following elements: in main() -opens the 2 files provided for...

C++

Write a program with the following elements:

in main()

-opens the 2 files provided for input (Lab_HW9_2Merge1.txt and Lab_HW9_2Merge2.txt)

-calls a global function to determine how many lines are in each file

-creates 2 arrays of the proper size

-calls a global function to read the file and populate the array (call this function twice, once for each file/array)

-calls a global function to write out the 'merged' results of the 2 arrays

*if there are multiple entries for a person, these should be merged and should appear as a single entry in the resulting file

*resulting file should be named 'merged_output.txt'

program should check to see if a name is already present in one file or another. If the name is present in both files display the name once in the merged file and add the numbers.

Example:

1st File:

Carlos 7

Tina 3

2nd File:

Lena 2

Carlos 3

Merged File:

Carlos 10

Tina 3

Lena 2

In: Computer Science