1answer.
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
mario62 [17]
3 years ago
12

Define the summary function, which takes as arguments a database (dict) and a dict of current stock prices. It returns a diction

ary (dict or defaultdict) whose keys are client names (str) whose associated values are 2-tuples: the first index is a dictionary (dict or defaultdict) whose keys are stock names (str) and values are the number of shares (int) the client owns. The second index is the amount of money (int) the portfolio is worth (the sum of the number of shares of each stock multiplied by its current price). Assume each client starts with no shares of any stocks, and if a client owns 0 shares of a stock, the stock should not appear in the client’s dictionary. Recall positive numbers are a purchase of the stock and negative numbers a sale of the stock. E.g., if db is the database above, calling summary(db, {'IBM':65, 'Intel':60, 'Dell':55, 'Apple':70}) would return
Computers and Technology
1 answer:
lozanna [386]3 years ago
5 0
Hi :). (_define Your question to answer) ,
You might be interested in
How does having constraints placed on a design change the engineering process
Delvig [45]
Having constraints on a design will change the engineering process and the process will take a long time to finish. The process eats up time, quality and budget especially when it involves prototypes and the like. Some common constraints involve the design itself and the engineer. 
8 0
4 years ago
Read 2 more answers
GUYSSS!!!
otez555 [7]
Yea, I don’t think you can fix it unless you backed it up or something somehow...
8 0
3 years ago
Read 2 more answers
How can we use sprites to help us keep track of lots of information in our programs?
DIA [1.3K]

Explanation:

what kind of sprites do you mean?

8 0
3 years ago
How might you develop a game where players need strong twitch skills in a way that still makes the game fun for players of all s
eimsori [14]

Answer:

here ya go

Explanation:

I would suggest either having a default difficult being easy, and if people want to be challenged they can increase it, or try to balance how much of the game requires strong twitch skills.

7 0
4 years ago
write a function issorted() that accepts an array of real numbers arr and an integer n as arguments, where n is the size of arr.
lesantik [10]

Answer:

Here is code in java.

import java.util.*;

class Main

{

//main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       int m;

        // scanner object to read input from user

       Scanner ss=new Scanner(System.in);

       System.out.println(" size  of the array:");

       //read the size of the array

        m=ss.nextInt();

        // create array of the given size

        float arr[]=new float[m];

        /* call function to check whether input are in the ascending sorted order or not */

        Boolean res= issorted(arr,m);

       

      // print the result

       System.out.println("array in the ascending sorted order  : "+res);

     

       

   }catch(Exception ex){

       return;}

}

 // function to check whether input are in the ascending sorted order or not

public static boolean issorted(float[] arr,int n)

{

    int i,j;

    float d;

    Boolean flag=true;

    Scanner ss=new Scanner(System.in);

    System.out.println("enter the elements of the array:");

     // read elements of the array

    for(i=0;i<n;i++)

    {

        arr[i]=ss.nextFloat();

    }

   

    // check elements re in the ascending order or not

    for(j=0;j<n-1;j++)

    {

        if(arr[j]>arr[j+1])

        {

            flag=false;

            break;

        }

    }

     // return the result

    return flag;

}

}

Explanation:

With the help of scanner class object, read the size "m" of array.Create an array of  the given size. Pass array and integer into the function issorted(). Read the elements of the array and then check elements are in the ascending order or not.It will return "true" if elements are in the sorted order else it will return "false".

Output:

enter  size  of the array:                                                                                                                                    

5                                                                                                                                                              

enter the elements of the array:                                                                                                                              

1 2 3 4 7                                                                                                                                                      

array in the ascending sorted order  : true                                                                                                                              

enter  size  of the array:                                                  

5                                                                            

enter the elements of the array:                                              

2 4 9 3 5                                                                  

array in the ascending sorted order  : false

7 0
4 years ago
Other questions:
  • What’s good and bad about having social media?
    14·2 answers
  • In the output at the command line from a router that reads - ip ospf message-digest-key 1 md5 CISCO-123 - what does the CISCO-12
    15·1 answer
  • What is the function of the command prompt?
    8·1 answer
  • When the atmosphere has too much carbon dioxide in it, the oceans absorb some of it to achieve a new balance. This is an example
    9·2 answers
  • Discuss, in brief thedifferent variations of BLAST. (Maximum 5 innumber)
    10·1 answer
  • Which option should you select to accept a tracked change? A. Accept B. Reject C. Review D. Delete
    8·2 answers
  • KeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKeyonnnKe
    8·2 answers
  • Edhesive lesson practice 8.3, question 5
    10·1 answer
  • How can you have internet without subscribing to cable?
    13·1 answer
  • Who is this wrong answers only
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!