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
butalik [34]
2 years ago
15

For each of the following data storage needs, describe which abstract data types you would suggest using. Natural choices would

include list, set, map, but also any simpler data types (string, int, double) that you may have learned about before.
Try to be specific, e.g., rather than just saying "a list", say "a list of integers" or "a list of names (strings) and a GPA (double)". If you specify a map please describe what the key and value will be. Also, please give a brief explanation for your choice: we are grading you at least as much on your justification as on the correctness of the answer. Also, if you give a wrong answer when you include an explanation, we'll know whether it was a minor error or a major one, and can give you appropriate partial credit. Also, there may be multiple equally good options, so your justification may get you full credit.
a. a data type that allows quick retrieval of the name of a song given the name of a playlist (or album) and the track number
b. a data type to store the text of the steps of a recipe for how to bake a cake
c. a data type that associates a file extension with the possible programs that are able to read/open that kind of file
d. a data type that stores all the TV station identifications (e.g. KABC, KNBC, etc.)
Computers and Technology
1 answer:
timofeeve [1]2 years ago
8 0

Answer:

Explanation:

1. data type which allows quick retrieval of the name of a song given the name of a playlist(or album) and the track number would be :

map

It can be defined as a key-value pair where combination of playlist-track number would be the the key and song name/details would be the value for that corresponding key

2. data type to store the text of the steps of a recipe for how to bake a cake would be :

list

list of string datatype can be used : each item in the list will have recipe in the data part of the node

3. data type for storing file extension with the possible programs that are able to read/open that kind of file wold be

set

It can be defined as a key-value pair where file extension would be the the key and possible program list would be the value for that corresponding key

4. data type that stores all the TV station identifications (e.g. KABC, KNBC, etc..) would be :

map

as there is no duplication in the names of TV station so map with key/value pair of TV station name /details would be appropriate to be used

You might be interested in
using a timer to generate a random number, develop a program that displays random numbers between 1 and 47 (or whatever) for you
mestny [16]

Answer:

Explanation:

The following code is written in Python. It creates a variable that detects the current time. Then it loops through a range of numbers and chooses the last random number after 2 seconds. Finally, it prints that number to the screen. This function can be called countless times depending on the number of state lottery numbers needed.

import random

import time

start_time = time.time()

while time.time() - start_time < 2:

   lottery_number = random.randint(0, 48)

print(lottery_number)

3 0
3 years ago
In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends deci
pickupchik [31]

Answer:

The java program for the given scenario is as follows.

import java.util.*;

import java.lang.*;

public class Main

{

   //variables for bill and tip declared and initialized

   static double bill=47.28, tip=0.15;

   //variables for total bill and share declared

   static double total, share1;

public static void main(String[] args) {

    double total_tip= (bill*tip);

    //total bill computed

    total = bill + total_tip;

    //share of each friend computed

    share1 = total/2;

    System.out.printf("Each person needs to pay: $%.2f", share1);  

}

}

Explanation:

1. The variables to hold the bill and tip percent are declared as double and initialized with the given values.

static double bill=47.28, tip=0.15;

2. The variables to hold the values of total bill amount and total tip are declared as double.

3. All the variables are declared outside main() and at class level, hence declared as static.

4. Inside main(), the values of total tip, total bill and share of each person are computed as shown.

double total_tip= (bill*tip);

total = bill + total_tip;

share1 = total/2;

5. The share of each person is displayed to the user. The value is displayed with only two decimal places which is assured by %.2f format modifier. The number of decimal places required can be changed by changing the number, i.e. 2. This format is used with printf() and not with println() method.

System.out.printf("Each person needs to pay: $%.2f", share1);  

6. The program is not designed to take any user input.

7. The program can be tested for any value of bill and tip percent.

8. The whole code is put inside a class since java is a purely object-oriented language.

9. Only variables can be declared outside method, the logic is put inside a method in a purely object-oriented language.

10. As shown, the logic is put inside the main() method and only variables are declared outside the method.

11. Due to simplicity, the program consists of only one class.

12. The output is attached.

5 0
3 years ago
Read 2 more answers
a network administrator for a large oil company has discovered that a host on the company network has been compromised by an att
Slav-nsk [51]

My recommendation as an immediate response to prevent further spoofing of the host is to Revoke the host's certificate.

<h3>What does revoke certificate mean?</h3>

Certificate revocation is the process by which one can  invalidate a TLS/SSL and this is one that is often done before its scheduled expiration date.

Note that A certificate need to be revoked immediately  and as such, based on the case above, My recommendation as an immediate response to prevent further spoofing of the host is to Revoke the host's certificate.

Learn more about network administrator from

brainly.com/question/4264949

#SPJ1

8 0
2 years ago
Only the root user can modify a file that has the immutable attribute set.
Vladimir79 [104]
False if the roots modify it’s capable of it’s attributed set
8 0
1 year ago
C++
Cerrena [4.2K]

Answer:

#include <iostream>

#include<iomanip>

using namespace std;

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon)

{

  double dollarCost = 0;

  dollarCost = (dollarsPerGallon * drivenMiles) / milesPerGallon;

  return dollarCost;

}

int main()

{

  double miles = 0;

  double dollars = 0;

  cout << "Enter miles per Gallon   : ";

  cin >> miles;

  cout << "Enter dollars per Gallon: ";

  cin >> dollars;

  cout << fixed << setprecision(2);

  cout << endl;

  cout << "Gas cost for 10 miles : " << DrivingCost(10, miles, dollars) << endl;

  cout << "Gas cost for 50 miles : " <<DrivingCost(50, miles, dollars) << endl;

  cout << "Gas cost for 400 miles: "<<DrivingCost(400, miles, dollars) << endl;

  return 0;

}

Explanation:

  • Create a method definition of DrivingCost that accepts  three input double data type parameters drivenMiles,  milesPerGallon, and dollarsPerGallon and returns  the dollar cost to drive those miles .
  • Calculate total dollar cost and store in the variable, dollarCost .
  • Prompt and read the miles and dollars per gallon  as input from the user .
  • Call the DrivingCost function three times  for the output to the gas cost for 10 miles,  50 miles, and 400 miles.

 

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which protocol is often used to publish web pages to a web server?
    5·1 answer
  • For a loop counter, the appropriate data type would be:
    14·1 answer
  • Which of the following commands would I use to begin a new presentation?
    14·1 answer
  • The term ____ means that a public information network such as an Internet service provider (ISP) should treat all users, all pla
    9·1 answer
  • Items that are cut or copied are placed on the Clipboard.
    6·2 answers
  • Why is distance learning better
    12·2 answers
  • A-1 grdening supply is preparing a reprt to hand out to the customerez in pointes form only.why should the reprts writers avoid
    9·2 answers
  • Any correct answers will be helpful.
    13·1 answer
  • These 2 questions PLEASEEE (:
    14·1 answer
  • Magnetic video tape in a plastic casing is a?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!