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
Elena-2011 [213]
2 years ago
13

4.17 LAB: Data File A comma separated value (.csv) file has been included to be used for this program. Each line contains two va

lues, a name and a number separated by a comma (except the first line, which contains the titles for the value types). The name is that of a writer and the number refers to the number of works the writer has written. Ex. Jane Austen,6. Each line is an entry and each entry number can be updated by identifying the associated name. Once complete, the following program opens data file allWorks.csv and asks if the user wants to update entries or add new entries. All entries are stored in an array while being read in and updated. The program then writes the array to the file, overwriting the original contents. The following TODO sections must be completed. Open allWorks.csv for reading/input. Locate an entry to be updated by name (use the Java String indexOf() method) Add a new entry if the name isn't found in the file (give the entry a new number) Open file allWorks.csv for output Write contents of the array to allWorks.csv (original file is overwritten)
Computers and Technology
1 answer:
Andrej [43]2 years ago
7 0

Answer:

import csv

def Csvreader(filename):

   with open("filename", "r") as file:

   content = file.csv_reader()

   list_content = list(content)

   file.close

   return list_content

Explanation:

This is a python description of the function that reads the csv file and converts it to a list, from the list, each item can accessed with its index and updated directly. Use this to draw the same conclusion for a java program.

You might be interested in
4.2 Code Practice: Question 2
skad [1K]

I've included my code in the picture below. Best of luck.

5 0
2 years ago
Read 2 more answers
python Write a function that computes a future investment value at a given interest rate for a specified number of years. The fu
Svetlanka [38]

Answer:

def future_investment_value(investment, monthly_interest_rate, years):

  print("Years\tFuture Value")

  print("- - - - - - - - - - -")

  for i in range(1, years+1):

      future_value = investment * ((1 + monthly_interest_rate) ** (12 * i))

      print(i, "\t\t", format(future_value, ".2f"))

investment = float(input("Enter the invesment amount: "))

interest = float(input("Enter the annual interest rate: "))

year = int(input("Enter the year: "))

future_investment_value(investment, interest/1200, year)

Explanation:

Inside the function:

- In the for loop that iterates through the years, calculate the future value using the formula and print the results

Then:

- Ask the user for the investment, annual interest rate, and year

- Call the function with the given inputs

4 0
2 years ago
What are the results of Maya’s conspicuous consumption? Check all that apply. - a lack of debt - stress about paying bills - a l
kifflom [539]

Answer:

stress about paying bills

a lack of money for other expenses

great electronic connectivity

Explanation:

The Maya classic period has seen the rise of conspicuous and mass consumption. In the given scenario all the expense her paid by credit cards and cash is rarely used. There will be a stress for paying bills. There will be lack of money available in hand for some routine expenses and mandatory purchases. It gives a great electronic connectivity. All the funds are considered as safe.

4 0
2 years ago
// This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their
Vikki [24]

Answer:

C++ code is given below

Explanation:

#include<iostream>

#include <cstring>

using namespace std;

int housekeeping(string EOFNAME);

int mainLoop(string name,string EOFNAME);

int finish();

void main()

{

  string name;

  string EOFNAME = "ZZZZ";

  cout << "enter the name" << endl;

  cin >> name;

  if (name != EOFNAME)

  {

      housekeeping(EOFNAME);

  }

  if (name != EOFNAME)

  {

      mainLoop(name , EOFNAME);

  }

  if (name != EOFNAME)

  {

      finish();

  }

  system("pause");

}

int housekeeping(string EOFNAME)

{  

  cout << "enter first name " << EOFNAME << " to quit " << endl;

  return 0;

}

int mainLoop(string name, string EOFNAME)

{  

  int hours;

  int rate,gross;

  int DEDUCTION = 45;

  int net;

  cout << "enter hours worked for " << name << endl;

  cin >> hours;

  cout << "enter hourly rate for " << name << endl;

  cin >> rate;

  gross = hours*rate;

  net = gross - DEDUCTION;

  if (net > 0)

  {

      cout << "net pay for " << name << " is " << net << endl;

  }

  else

  {

      cout << "dedections not covered.net is 0.";

  }

  cout << "enter next name or " << EOFNAME << " to quit" << endl;

  cin >> name;

  return 0;

}

int finish()

{

  cout << "end of job"<<endl;

  return 0;

}

3 0
2 years ago
Scenario 1: Richman Investments provides high-end smartphones to several employees. The value of each smartphone is $500, and ap
vfiekz [6]

Answer:

a). SLE =$37.5

b). ARO =75

c). ALE = $2,812.5

Explanation:

a).Single loss Expectancy (SLE) is starting point in determining the single loss of an asset that will occur and calculated this;

SLE = asset value * exposure factor.

Asset value =$500,

Exposure factor is simply the percentage of asset lost.

In this case out of 1000 phones, 75 were damaged or loss.

In percentage;

75 ÷ 1000 =0.075, 0.075×100=7.5%(exposure factor).

Therefore,

SLE = $500×7.5%= $37.5.

b). ARO - Annual Rate of Occurrence is the number of times a threat on a single asset is expected to occur in one year.

In the case the damage or loss occured in 75 devices in one year.

c). ALE - Annualized loss Expectancy is the product of SLE and ARO.

Therefore;

ALE = $37.5 × 75 = $2,812.5.

3 0
2 years ago
Other questions:
  • FOREACH, EXPLODE and MAIL are examples of crazy functions.
    13·1 answer
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • Create a class called Date that includes three pieces of information as instance variables—a month (type int), a day (type int),
    11·1 answer
  • Which item follows html instructions to assemble web pages
    13·1 answer
  • Write the notInVocab method. Assume that there are no duplicates in wordArray. You must call findWord and countNotInVocab approp
    10·1 answer
  • In this exercise we look at memory locality properties of matrix computation. Th e following code is written in C, where element
    9·1 answer
  • In Java please.
    12·1 answer
  • Recall that a Set is an abstract data type somewhat similar to a Bag, they can store a finite collection of objects without any
    8·1 answer
  • In a system where Round Robin is used for CPU scheduling, the following is TRUE when a process cannot finish its computation dur
    13·1 answer
  • What are the two atomic operations permissible on semaphores?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!