Creating an array of names

Assignment Help C/C++ Programming
Reference no: EM13811879

Just write the codes and label my variables.

Example: (with Python not C++)

# This program will Combine lists together

# Creating an array of names

Names = ['Turner', 'Philips', 'Stevenson', 'Jones', 'Gonzalez', 'Whitaker', 'Bruner', 'Webster', 'Foster', 'Anderson', 'Klein', 'Connors', 'Rivers', 'Wilson', 'Duncan']

# Creating an array with integer type

Grades = [94, 82, 87, 78, 65, 90, 85, 97, 70, 100, 57, 88, 73, 92, 84]

# Function that computes average for the given list of items

def average(g_list):

# Returns the length of the list

sum = 0

n = len(g_list)

for i in range(n):

# Adding each element

sum = sum + g_list[i]

# Calculating the average

return sum/float(n)

# Calculates the average

avg = average(Grades)

# Prints the average

print (avg)

# Function to calculate the median of the given list

def median(g_list):

#lst = g_list

#even = (0 if len(lst) % 2 else 1) + 1

#half = (len(lst) - 1) / 2

#return sum(sorted(lst)[half:half + even]) / float(even).

Reference no: EM13811879

Questions Cloud

Analyza the risk assessment in construction management : Analyza the Risk Assessment in Construction Management. Visit a construction site and identify all actual and inherent risks seen. Provide the location and time of visit.
Major components of a human resources plan : Part of project implementation or execution is having a human resources plan. What are the major components of a human resources plan?
Constitutional order and government stability : Constitutional Order and Government Stability
Important skill and process in project management : What value does using graphics add to the project management process? Why is estimation an important skill and process in project management?
Creating an array of names : Just write the codes and label my variables. Example: (with Python not C++). Creating an array of names
Quality culture and a traditional culture : There are various differences between a quality culture and a traditional culture. While formulating strategies and implementing quality culture, you need to understand these differences and plan accordingly.
Coefficient of kinetic friction between the tires of the car : What will be the net velocity of the ship if the captain points his ship on a bearing of 55° North or West and applies full power?
Commercialization of organ transplants : Commercialization of Organ Transplants
Explain the five-component model : List and briefly explain the five-component model of an information system. How can you use them?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to create 100 real random numbers

Write a program to create 100 real random numbers and store it into a 1-D array.

  Program to generate 100,000 prime numbers

Write a POSIX C/C++ program to generate 100,000 prime numbers. Assume that the program will be run on a computer with 5 CPUs and that your goal is to have this program finish as quickly as possible.

  Define a 2-element array of characters

Write an if statement that sets the variable age to 21 when the flag variable adult is set and define a 2-element array of characters named alpha initialized with the characters P, Q.

  Write a very basic doubly-linked list

CptS 122 Lab #2: Linked Lists ,  Along with vectors, linked lists are one of the fundamental data structures in computer science. Unlike vectors, which store information in a contiguous block of computer memory, linked lists have the potential to sto..

  Program that incorporates these two functions

Write the program that incorporates these two functions, as described. You will notice that the two functions have very similar statements, so you are doing some repetitive C++ code.

  Print out the sum of all numbers, the average

Write a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is attempting to read

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

  Calculates how much a little league baseball team spent

Prepare a program that calculates how much a little league baseball team spent last year to purchase new baseballs.

  Write in c a program to continuously read the dip switches

Write in C a program to continuously read the DIP switches connected to PORTA and send it to PORTB. Assume that eight DIP switches are connected to PORTB and eight LEDs are connected to PORTC. Assume that the switch values are normally high. Turn a..

  Write a console-based object-oriented c++ program

Write a console-based object-oriented C++ program that generates a random number and prompts the user to guess it

  A computational study of a spring-mass system in steady

a computational study of a spring-mass system in steady stateidealized spring-mass systems have numerous applications

  Use the lengthof the side as a member variable of the class

write a class including four member functions to compute the areas of an equilateral triangle ,square,hexagon and octagon respectively .Use the lengthof the side as a member variable of the class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd