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
damaskus [11]
3 years ago
15

Write an application that displays the sizes of the files lyric1.txt and lyric2.txt in bytes as well as the ratio of their sizes

to each other.
Computers and Technology
1 answer:
viva [34]3 years ago
4 0

Answer:

#include<iostream>

#include<fstream>

using namespace std;

int main() {

  ifstream file_one("lyric1.txt", ios::binary);

  ifstream file_two("lyric2.txt", ios::binary);

  file_one.seekg(0, ios::end);  // retrieving file size of lyric1.txt file

  file_two.seekg(0, ios::end);  // retrieving file size of lyric2.txt file

  // converting the binary file size to an integer.

  int fileOne = file_one.tellg();

  int fileTwo = file_two.tellg();

  cout<<"Size of the lyric1.txt is"<<" "<< fileOne<<" "<<"bytes";

  cout<<"Size of the lyric2.txt is"<<" "<< fileTwo<<" "<<"bytes";

  cout<< fileOne <<" : "<< fileTwo;

Explanation:

The source code gets the file size of two word files and displays them in bytes and also displays the ratio of both files.

You might be interested in
An ______ search is when the buyer looks for information beyond personal knowledge to help make the buying decision, such as che
victus00 [196]

Answer: External

Explanation: External search could be explained as the additional information gathered beyond an individual's personal knowledge or experience in a bit to influence the individual's decision on a particular product or topic. This additional information could include; information sought from friends and families, online or internet research on relevant site, blogs or publications.

Therefore, a buyer who asks a friend, checking the internet or visiting a showroom or make other enquiries beyond his personal knowledge in other to make buying decision is making an external search.

6 0
3 years ago
Explain how loops can be utilized in list processing. Please provide Python examples in your response.
Dominik [7]

Answer:

data = [0,1,2,3,4]

for i in range(4):

   print(data[i])

   i+=1

Explanation:

Loops can be utilized in a listing process by looping back to a list with a variable while the loop increases that variable to give a different response from the list.

8 0
2 years ago
What does =SUM(B2:B6) mean
dedylja [7]

In Excel the sum B2 and B6 simply means that B2 and B6 Numbers are adding to get a Sum, it actually like the normal Calculator, but in Excel it helps to do the calculation of your your data simple and easy, there is no hard work.

8 0
3 years ago
* Describe the five components of a<br> computer
LenaWriter [7]

Answer:

Computer systems consist of three components as shown in below image: Central Processing Unit, Input devices and Output devices. Input devices provide data input to processor, which processes data and generates useful information that's displayed to the user through output devices. This is stored in computer's memory.

5 0
2 years ago
Read 2 more answers
To add a slide using the default layout, what should you do before clicking the New Slide button?
SIZIF [17.4K]

You have to add it and then there should be a layout button and you have to press that button

4 0
3 years ago
Other questions:
  • You are reluctant to write an extra credit book report because you are afraid that your language and punctuation skills are not
    11·1 answer
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • Which of the following is NOT one of the most important elements when designing a website?
    8·2 answers
  • How can i do a back up on one computer and save it to the hard drive in another computer without it being seen by others on the
    9·1 answer
  • Which destination ip address is used when an ipv6 host sends a dhcpv6 solicit message to locate a dhcpv6 server?
    15·1 answer
  • Which statement reflects inherent bias in reading and learning about our world?
    12·1 answer
  • The expression that is tested by a switch statement must have a(n) __________ value.
    12·1 answer
  • Create a derived class called Car that inherits from Vehicle. The constructor should call the base class constructor, with 4 for
    13·1 answer
  • Networks that are designed to connect similar computers that share data and software with each other are called:
    10·1 answer
  • Using complete sentences post a detailed response to the following.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!