Question

In: Computer Science

- Imagine each of the following items is a piece of information and we want to...

- Imagine each of the following items is a piece of information and we want to define a variable in Python to keep the value of these items in the memory of the computer. For instance, in order to represent a person age, we can define a variable like the following variable and initialize it with a sample value:

age = 23, the type is integer

  • - For each of the following items, define a variable and initialize it with a sample value and explain what data type or data structure you would use to represent the item.

  • - Student number

  • - Student number of students in CSCI120

  • - Your car model (for instance BMW)

  • - An .mp3 music file (for example: mySong1.mps)

  • - The information of the following table: First column is the item and the second column is the

  • weight of the item.

    Item

    iPhone iPad
    cup keychain watch

    -

    Weight (lb)

    Item

    Weight (lb)

    10

    Tea box

    9

    12

    notebook

    16

    5

    ring

    2

    7

    battery

    5

    13

    sanitizer

    7

    write a python code

Solutions

Expert Solution

# Student number
studentNumber=23
#using an integer data type to store the value

#Student number of students in CSCI120
studentNumbers=[1,2,3]
#using a list of integers

#Your car model (for instance BMW)
carModel = 'BMW'
#using string data type

#An .mp3 music file (for example: mySong1.mps)
song = 'mySing1.mps'
#using string datatype

#The information of the following table: First column is the item and the second column is the weight of the item.
data={"iPhone":10,"iPad":12,"cup":5,"keychain":7,"watch":13,"Tea box":9,"notebook":16,"ring":2,"battery":5,"sanitizer":7}
#using a dictionary to store key value pairs, where keys are string data type storing item names, and values are integers
#storing weight


Related Solutions

By definition, if we say that a piece of information is accurate we mean that: It...
By definition, if we say that a piece of information is accurate we mean that: It is worth its cost to collect It is based on correct and complete data and processed correctly as expected It supports its purpose without any extra It was produced in time for its intended use It is on the subject and appropriate for the context Cardinality as discussed in class identifies: The number of tables in a schema The primary and foreign key fields...
Please show the following each on a separe piece of paper on the information below: 1....
Please show the following each on a separe piece of paper on the information below: 1. General Journal 2. General Ledger ( T- Accounts) 3. Adjusted Trial Balance 4. All Finanical Statements 5. Post-Closing Trial Balance Julie Molony opened Julie's Maids Cleaning Service Inc. on July 1, 2011. During July the company completed the following transactions. July 1 - Stockholders invested $14,00 cash in the business in exchange for common stock July 1- Purchased a used truck for $10,000, paying...
Suppose we have 6 distinct items and we want to place 4 in one bin and...
Suppose we have 6 distinct items and we want to place 4 in one bin and 2 in the other. How many ways can this be done if order does not matter? (answer is 15)
Suppose you have N items with values xi from which we want to sample n items...
Suppose you have N items with values xi from which we want to sample n items with replacement. Each item has its own probability pi of being selected across all times we pick items. What's the estimated variance of the Horvitz-Thompson estimator of T? Let T = > 1, 1=1
Suppose you have N items with values xi from which we want to sample n items...
Suppose you have N items with values xi from which we want to sample n items with replacement. Each item has its own probability pi of being selected across all times we pick items. What's the bias for the following estimator of T: Let T = > 1, 1=1
Check the requirements for confidence intervals using the following information: Suppose we want to estimate the...
Check the requirements for confidence intervals using the following information: Suppose we want to estimate the proportion of American teenagers who would rather own movies physically vs those who would rather own movies digitally. A survey of 45 American teenagers finds that 12 of them would rather own movies physically. With this information, you plan to create a 95% Confidence Interval for the true proportion of Americans who would rather own movies physically. Conditions: i. The method of sampling      ...
This data contains information on 78 seventh-grade students. We want to know how well each of...
This data contains information on 78 seventh-grade students. We want to know how well each of IQ score and self-concept score predicts GPA using least-squares regression. We also want to know which of these explanatory variables predicts GPA better. Give numerical measures that answer these questions. (Round your answers to three decimal places.) A. (Regressor: IQ) R 2    B. (Regressor: Self-Concept) R 2    obs gpa iq gender concept 1 7.94 118 2 38 2 8.292 136 2 62...
​​​​​Select the best answer for each of the following unrelated items. Answer each of these items...
​​​​​Select the best answer for each of the following unrelated items. Answer each of these items in your examination booklet by giving the number of your choice. For example, if the best answer for item (a) is (1), write (a)(1) in your examination booklet. If more than one answer is given for an item, that item will not be marked. Incorrect answers will be marked as zero. Marks will not be awarded for explanations. Which of the following is an...
In basket analysis, we want to find the dependence between two items X and Y. Given...
In basket analysis, we want to find the dependence between two items X and Y. Given a database of customer transactions, how can you find these dependencies? How would you generalize this to more than two items?
I want you to read the following piece (‘The Drowning Child and the Expanding Circle’ by...
I want you to read the following piece (‘The Drowning Child and the Expanding Circle’ by Peter Singer; see link below) and respond to questions #1-5 based on your reactions to this piece. For each question, make sure you not only directly answer each question, but make sure to spend at least 2-3 sentences explaining your answers. HYPERLINK "https://www.utilitarian.net/singer/by/199704--.htm" https://www.utilitarian.net/singer/by/199704--.htm 1. What are your overall impressions of the piece? 2. At what stage of the 5 stage model of helping...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT