ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 Jun 2017 My Price 8.00

The Weird Widget Company of New York

I need help with all three problems, but lets start with number one

 

 

Problem 1: The Weird Widget Company of New York has several stores inNew York. Each evening, the corporate office in midtown Manhattanreceives sales figures from each store in a list of tuples. Each tuplecontains two elements, (store, sales).Write a program that prints the total sales and the average sales forthe day. Use a for loop to calculate the total sales and the averagesales (try not to use any external libraries!).Example:daily_sales = [(‘A',150234.22),('B',73232.90),('C',110493.29),('D',231965.64),('E',66398.58)]Your program should print:Total sales today: $632324.63Average sales today: $126464.93What you need:1. set total_sales to 02.for: use a for loop to iterate through the daily_sales list addingthe second value of each tuple to total_sales at each iteration3.len: after the end of the loop, calculate the average. Use the lenfunction to figure out the number of data items (for the average)4.print formatting: print the results. You’ll need to format theaverage to two decimal places and add the $ sign in the front ofthe numbers.Problem 2: The corporate office of the Weird Widget Company of NewYork also has data on budgeted sales for each store. Budgeted Salesdata is stored in a dict with store identifiers as the key. Write aprogram that prints out the store identifiers of stores that haveunderperformed or over performed their budget by more than x%.Example:daily_sales = [(‘A’,150234.22),('B',73232.90),('C',110493.29),('D',231965.64),('E',66398.58)]budgeted_sales = {‘A’:140296.00,’B’:103981.00,’C’:80452.00,’D':200900.00,'E':90000.00}performance_threshold = 20Assignment 3

Attachments:

Answers

(11)
Status NEW Posted 06 Jun 2017 07:06 AM My Price 8.00

-----------

Not Rated(0)