answer.
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
daser333 [38]
2 years ago
6

You work for a shipping company and your manager receives orders from various customers everyday some existing ,some new .your m

anager wishes to establish a process to automate tracking the orders received by the company .you can assume the daily data arrives as lists/array/vector of strings and follows this exact format(note that customers may place separate orders in a single day):
day_i=["Bob:100","Alice:100","Celia:110","Bob:20",etc.]
write a script that, when given the daily data will keep track of purchase amount for each customer. you can assume the data already exists in the memory
Computers and Technology
1 answer:
Gennadij [26K]2 years ago
6 0

Answer:

It's good to consider this as a dictionary, with key-value pair, or as a two-dimensional array.

And in the first case, the code will be as below:

day_i={'Bob':'100', 'Alice':'100','Celia':'110','Bob':'200'}

for k, v in day_i.items():

print(k, v)

Explanation:

The above code reads through each day, and each customer purchase amount in the form of Dictionary, and prints each customer name and purchase amount. And with little enhancement, we can create each day data, and print details of the day, as being asked by the user.

You might be interested in
Write a SQL query to find the population of the planet named 'Caprica' -- 10 points Find the first name, last name, and age of p
Artemon [7]

The question is incomplete! Complete question along with answer and step by step explanation is provided below.

Please find the attached question.

Answer:

a) SQL Query:

SELECT population

FROM bsg_planets

WHERE name='Caprica';

b) SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE lname!='Adama';

c) SQL Query:

SELECT name, population

FROM bsg_planets

WHERE population > 2600000000

d) SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE age IS NULL;

Explanation:

a) Write a SQL query to find the population of the planet named 'Caprica'

Syntax:

SELECT  Column

FROM TableName

WHERE Condition;

For the given case,

Column = population

TableName  = bsg_planets

Condition = name='Caprica'

SQL Query:

SELECT population

FROM bsg_planets

WHERE name='Caprica';

Therefore, the above SQL query finds the population of the planet named 'Caprica' from the table bsg_planets.

b) Find the first name, last name, and age of people from bsg_people whose last name is not 'Adama'

Syntax:

SELECT  Column1, Column2, Column3

FROM TableName

WHERE Condition;

For the given case,

Column1 = fname

Column2 = lname

Column3 = age

TableName  = bsg_people

Condition = lname!='Adama'

SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE lname!='Adama';

Therefore, the above SQL query finds the first name, last name and age of people whose last name is not 'Adama' from the table bsg_people.

c) Find the name and population of the planets with a population larger than 2,600,000,000

Syntax:

SELECT  Column1, Column2

FROM TableName

WHERE Condition;

For the given case,

Column1 = name

Column2 = population

TableName  = bsg_planets

Condition = population > 2600000000

SQL Query:

SELECT name, population

FROM bsg_planets

WHERE population > 2600000000

Therefore, the above SQL query finds the name and population of the planets with a population larger than 2,600,000,000 from the table bsg_planets.

d) Find the first name, last name, and age of people from bsg_people whose age is NULL

Syntax:

SELECT  Column1, Column2, Column3

FROM TableName

WHERE Condition;

For the given case,

Column1 = fname

Column2 = lname

Column3 = age

TableName  = bsg_people

Condition = age IS NULL

SQL Query:

SELECT fname, lname, age

FROM bsg_people

WHERE age IS NULL;

Therefore, the above SQL query finds the first name, last name and age of people whose age is NULL from the table bsg_people.

6 0
2 years ago
Read 2 more answers
When onboard and facing the bow of a boat where is the port side
topjm [15]

Answer:

im pretty sure this is common sense

Explanation:

3 0
1 year ago
#You may modify the lines of code above, but don't move them! #When you Submit your code, we'll change these lines to #assign di
Musya8 [376]

Answer:

The solution code is written in Python:

  1. mystery_string = "Programming"
  2. output = ""
  3. for x in mystery_string:
  4.    output += x  
  5.    print(output)

Explanation:

Firstly, create a variable mystery_string to hold a random string (Line 1).

Create an output variable to hold an output string (Line 2).

Create a for-loop to traverse the mystery_string character by character (Line 4). In the iteration, get a character from the mystery_string, and concatenate it with output string (Line 5). Print the output string (Line 6) before proceed to the next iteration.

8 0
2 years ago
Audio tools support reading fluency by
Artist 52 [7]

Answer:

The answer is "demonstrating how a text is read".

Explanation:

Audio tools like Text to Speech are commonplace in programs like Duolingo. They offer you a somewhat accurate example of how to properly pronounce a word or phrase.

4 0
2 years ago
Read 2 more answers
​Scott works for an online retailer and has to format the border around each element on their web page. He has to set the border
Pavel [41]

Choices for the question are not given to select from, but the answer is obvious and unique so it is given below.

Answer:

border-color: grey, black, black, grey;

Explanation:

For making the colored borders on a web page, the property border-color of used. It has 1 to 4 elements/values  (as needed) to color the borders. The order of the borders (elements) is given below:

  1. top
  2. right
  3. bottom
  4. left

Now as explained above these elements can also be three instead of four displaying the colors of first three sides that are top, right and bottom.

Similarly, when one or two elements will be given the color of respective borders will be changed.

Note:

We should first set the border-style (design) property then move towards the color property.

i hope it will help you!

7 0
1 year ago
Other questions:
  • Ajay wants to read a brief overview about early settlers in the United States. Which type of online text source should he most l
    9·2 answers
  • Elaine is upset with her group members because she wanted to lead the group but is not allowed to. She found that other group me
    9·2 answers
  • Refer to the exhibit. pc1 issues an arp request because it needs to send a packet to pc3. in this scenario, what will happen nex
    9·1 answer
  • A ____ partition contains the data necessary to restore a hard drive back to its state at the time the computer was purchased an
    8·2 answers
  • add is a method that accepts two int arguments and returns their sum. Two int variables, euroSales and asiaSales, have already b
    11·1 answer
  • The major result of treating 1-butyne with 6M aqueous NaOH would be:_______.A. the production of an alkene.B. the production of
    10·1 answer
  • In defining security implemention, what are the roles of the following committees. 1) gateway committee 2) project committee 3)
    8·1 answer
  • You realize your computer has been infected with malware. It seems as if someone is controlling your computer from a remote loca
    5·1 answer
  • Which of the following sorting algorithms is described by this text? "Take the item at index 1 and see if it is in order compare
    10·1 answer
  • 3.34 LAB: Mad Lib - loops in C++
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!