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
beks73 [17]
3 years ago
15

Given an initialized variable fileName, write a sequence of statements that create a file whose name is given by the variable an

d whose content is a single line consisting of "This Is File: " followed by the name of the file. Make sure that the data written to the file has been flushed from its buffer and that any system resources used during the course of running these statements have been released.
Computers and Technology
1 answer:
steposvetlana [31]3 years ago
6 0

Answer:

In Python:

fileName = "myfile.txt"

fname = open(fileName, "w")

fname.write("This Is File: "+str(fileName))

fname.close()

Explanation:

This initializes fileName

fileName = "myfile.txt"

This creates the file in write mode

fname = open(fileName, "w")

This writes the required string to the file

fname.write("This Is File: "+str(fileName))

This closes the file

fname.close()

You might be interested in
Two or more computers connected together is referred to as a(n)
son4ous [18]
Two or more computers connected together is referred to as a network.
So the answer is <span>B. network.</span>
8 0
3 years ago
In order to manage information for a company, your website would need a/an
Eva8 [605]
The answer is database.
3 0
3 years ago
Akira has trouble reading what is on the computer screen and sometimes seeing pictures on websites. As her friend, you explain t
aliina [53]

1. Using Listener Software:

Software like Adobe reader allows you to listen to the stored files rather than reading them, Akira can use this software while she need to read a file or an article, simply copy the article in pdf file and turn on listener for it.

2. Zoom in/ Zoom Out:

Most of the browsers these days allow you to zoom in and zoom out the web pages while reading them by pressing Alt and + sign for Zoom in and Alt and - for zoom out. This feature can be really helpful for reading purposes and also for images view as well.

3. Narrators

When Akira is completely fed up with reading the screen, she can use Narrators which are programs that convert every text on screen into audio file and she can listen to them.

4.Color Changers

These days software like color changer are very useful for people with low vision eyes. They change the color of screen such that there is no irritation in eyes while reading articles. They can also be used by her.

7 0
3 years ago
Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubl
lianna [129]

Answer:

The C++ code is given below with appropriate comments

Explanation:

#include "stdafx.h"

//Header file section

#include <iostream>

#include <iomanip>

#include <string>

using namespace std;

//Function prototypes

double rainfallTotal(double[], int);

double averageMonthlyRainfall(double[], int);

double highestAmountRainfall(double[], int, int &);

double lowestAmountRainfall(double[], int, int &);

int main()

{

//Initialize variables

const int ALL_MONTHS = 12;

int highIndex = 0;

int lowIndex = 0;

//Declare variables

double totalRf;

double averageRf;

double mostRf;

double leastRf;

double monthlyRf[ALL_MONTHS];

string monthName[ALL_MONTHS] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };

for (int i = 0; i < ALL_MONTHS; i++)

{

 cout << "Enter rainfall for " << monthName[i] << ": ";

 cin >> monthlyRf[i];

 // Check the input as negative numbers

 //for monthly rainfall

 while (monthlyRf[i] < 0)

 {

  cout << "Invalid data (negative rainfall) " << endl;

  cout << "Retry the rainfall in " << monthName[i] << ": ";

  cin >> monthlyRf[i];

 }

}

//Call the methods

totalRf = rainfallTotal(monthlyRf, ALL_MONTHS);

averageRf = averageMonthlyRainfall(monthlyRf, ALL_MONTHS);

mostRf = highestAmountRainfall(monthlyRf, ALL_MONTHS, highIndex);

leastRf = lowestAmountRainfall(monthlyRf, ALL_MONTHS, lowIndex);

//Display output

cout << fixed << showpoint << setprecision(2) << endl;

cout << "Total rainfall: " << totalRf << endl;

cout << "Average rainfall: " << averageRf << endl;

cout << "Least rainfall in " << monthName[lowIndex] <<endl;

cout << "Most rainfall in " << monthName[highIndex] <<endl;

system("pause");

return 0;

}

//Method definition of rainfallTotal

double rainfallTotal(double totalRainfall[], int n)

{

double total = 0;

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

 total += totalRainfall[i];

return total;

}

//Method definition of averageMonthlyRainfall

double averageMonthlyRainfall(double totalRainfall[], int n)

{

double average = 0.0;

double total = 0;

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

 total += totalRainfall[i];

average = total / n;

return average;

}

//Method definition of lowestAmountRainfall

double lowestAmountRainfall(double totalRainfall[], int n, int &monthIndex)

{

double least;

int i = 0;

least = totalRainfall[i];

while (i < n)

{

 if (totalRainfall[i] < least)

 {

  least = totalRainfall[i];

  monthIndex = i;

 }

 i++;

}

return least;

}

//Method definition of highestAmountRainfall

double highestAmountRainfall(double totalRainfall[], int n, int &monthIndex)

{

double high;

int i = 0;

high = totalRainfall[i];

while (i < n)

{

 if (totalRainfall[i] > high)

 {

  high = totalRainfall[i];

  monthIndex = i;

 }

 i++;

}

return high;

}

3 0
3 years ago
A laptop is running hotter than normal, and its cooling fan sounds slower than usual. Which is the most likely problem?
Katena32 [7]

your laptop has too many programs running and the computer cannot keep up with them which causes the laptop to overheat. the fan is running at a normal pace, it's just not fast enough to cool down the laptop because there are too many programs running bogging down the system.

7 0
3 years ago
Read 2 more answers
Other questions:
  • What are the 6 external parts of a computer
    14·1 answer
  • Why is important to build strong connections
    9·2 answers
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • The advent of optical discs was made possible by developments in ____ technology.
    5·1 answer
  • Write a Python 3 script in PyCharm that will simulate the game of "Rock, Paper, Scissors": Display a header and the simple rules
    8·1 answer
  • Choose the correct term to complete the sentence.
    15·2 answers
  • A(n) __________ is a server with the original copy of the data that others need.
    12·1 answer
  • Question 3 (2 points)
    6·1 answer
  • Who is the host in super monkey ball?
    14·1 answer
  • Question:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!