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
exis [7]
3 years ago
7

Assume a file containing a series of integers is named numbers.txt and exists on the computer’s disk. Write a program that reads

all of the numbers stored in the file, calculates their total and displays it.
Very Important: The file could have any number of numbers, so you need to use a loop to process the data in the file
Computers and Technology
1 answer:
gtnhenbr [62]3 years ago
6 0

#include <iostream>

#include <fstream>

using namespace std;

int main(){

   int x, sum=0;

ifstream f("numbers.txt");

while(!f.eof()){

       f >> x;

       sum +=x;

}

cout << "Sum : " << sum;

}

<em />

<em>This is a C++ program.</em>

<em>Next time be more precise on the programming language you want</em>

You might be interested in
Please Complete in Java a. Create a class named Book that has 5 fields variables: a stock number, author, title, price, and numb
Gala2k [10]

Answer:

Explanation:

The following code is written in Java. I created both versions of the program that was described in the question. The outputs can be seen in the attached images below. Both versions are attached as txt files below as well.

Download txt
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
13e8818abb53c8bc7547a966a10a101d.jpg
8623bf9304771a3e1c8581a41a9c11f6.jpg
8 0
3 years ago
Which statement best justifies the use of a high-speed cache in a CPU?
crimeas [40]

Cache memory is a high-speed memory that stores the instructions and data that have been frequently accessed.  It decreases the time it takes to decode the instructions stored in the instruction pipeline.

A.  It decreases the time it takes to decode instructions stored in the instruction pipeline.

<u>Explanation:</u>

Whenever an instruction is invoked or some data is accessed, the CPU looks for it in the cache memory before accessing the main memory.

If the content is found in the cache memory, it accessed from there and then and hence the access time and decode time is reduced as there were no main memory lockups.

6 0
3 years ago
What framework uses CSS to access and manipulate HTML elements?
Jlenok [28]

Answer:

The correct answer is JQuery

Explanation:

JQuery uses CSS to access and manipulate HTML elements.

4 0
2 years ago
Something which has a special meaning in a python programming language is termed as what?
Elis [28]

Answer:

Explanation:

A Dutch programmer named Guido van Rossum made Python in 1991.This also means Python is slower than a compiled language like C, because it to avoid changing the language to make it better until they have a lot of things to change.

Python is an interpreted, high-level and general-purpose programming language. Created by  This compact modularity has made it particularly popular as a means of  a rough transcription from another programming language is called unpythonic. It has fewer syntactic exceptions and special cases than C or Pascal.

plz mark as brainliest

6 0
3 years ago
Jose has 3/5 kilogram of peppermints and 2/3 kilogram of candy canes. How many kilograms of candy does he have?
yarga [219]

Answer:

\frac{19}{15}\\

≅ 1.267

Explanation:

\frac{3}{5} +\frac{2}{3} \\\\= \frac{9}{15} + \frac{10}{15} \\\\= \frac{9+10}{15} \\\\= \frac{19}{15} \\\\= 1.267

6 0
2 years ago
Other questions:
  • Which of the following is the path to the zoom button? select one:
    5·2 answers
  • Three IT Companies. Help me please!
    5·2 answers
  • What is the output from this program? #include void do_something(int *thisp, int that) { int the_other; the_other = 5; that = 2
    8·1 answer
  • Maria works for MegaCorp, a large privately owned company specializing in sales of ball bearings. MegaCorp introduces filtering
    15·1 answer
  • For which type of long-distance call do you need to tell the operator the name of the person to whom you wish to speak?
    10·1 answer
  • Which behavior of the application should the user expect? A user profile has login hour restrictions set to Monday through Frida
    12·1 answer
  • Edhesive 9.10 Question 3
    13·2 answers
  • What is the limitation of computer<br>​
    5·1 answer
  • You connect your computer to a wireless network available at the local library. You find that you can access all of the websites
    6·1 answer
  • Arrange the code so that the numbers are swapped.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!