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
svetoff [14.1K]
3 years ago
6

AddAll - Adds all the doubles in the string with each other. Note every double is separated by a semi-colon. AddAll("1.245;2.9")

=>4.145 double AddAll(const char* str) struct Sale char Person[100]; double sale; double tax; struct SaleStatistic double average Sale; double totalSale; double totalTax; (4) AddAl - Adds all the doubles in the string with semi-colon. AddAll("1.245;2.9")=>4.145 double AddAll(const char* str) { ww struct Sale { char Person[100]; double sale; double tax; }; struct SaleStatistic -- double average Sale: double totalSale: double totalTax:
Computers and Technology
1 answer:
ludmilkaskok [199]3 years ago
3 0

Answer: provided below

Explanation:

The code is provided below/

// the method to add all double value in the string

double AddAll(const char *str)

{

double total = 0;

vector<string> vec;

 

stringstream strStream(str);

 

while (strStream.good())

{

string substr;

getline(strStream, substr, ';');

vec.push_back(substr);

}

 

for (size_t i = 0; i < vec.size(); i++)

{

total = total + stod(vec[i]);

}

return total;

}

 

Program code with addition of the above for testing is provided thus

#include <iostream>

#include <sstream>

#include <vector>

using namespace std;

//addin all double value in syring

double AddAll(const char *str)

{

double total = 0;

vector<string> vec;

 

stringstream strStream(str);

 

while (strStream.good())

{

string substr;

getline(strStream, substr, ';');

vec.push_back(substr);

}

 

for (size_t i = 0; i < vec.size(); i++)

{

total = total + stod(vec[i]);

}

return total;

}

int main()

{

//method calling and display result

cout<<AddAll("1.245;2.9");

}

This gives output as:

4.145

You might be interested in
I have a very quick question. So im applying for Early college and i need some future educational goals and maybe im just thinki
svetlana [45]

Answer:

no sé no entiendo inglés

5 0
2 years ago
Wired network are the most reliable and provide the highest speed?
lbvjy [14]

A wired connection is almost always reliable and fastest, so that one gets a True.

When it comes to wireless networks, it really just depends on how you're setting them up.  A normal wireless set up is generally effortless to set up because a lot of router manufacturers include wizards in the router's firmware to help you get started, so that gets a False.

8 0
3 years ago
What is the best Graphics Card you can get in a Gaming Computer? Also what is the RAM do in a Comptuer
saveliy_v [14]

Answer:

For Simple AAA. title games you can get a gtx 1050 ti which can run games decent about 60 fps on med to low settings i my self am running a r7 370 and i play FiveM at 40 fps or gta5 at 60 csgo at 120 fps if you want to go higher go with the best graphics and fps go with something cheap but extreme a RTX 2070 or 2080 and with ram it help the computer run smoother basically imagin what a plate is ram so more plates you have the more food you can store in it untill someone (the computer) uses it all its a quick storage for limited time the more the better usually for gaming a 16gb should be enough

Explanation:

5 0
3 years ago
In a c program, if you see a variable in main declared: float farray[20]; describe what farray is
Bas_tet [7]
An array of floats that can hold up to 20.
3 0
3 years ago
Yeoo check dis out!!!!!! wait my full vid dont show hol on
kifflom [539]

Answer:

das fire

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • What are a few benefits of virtualization?<br> How do they benefit ?
    9·1 answer
  • . It is essential for a relay energized by alternating current to have A. many turns of small wire. B. a laminated core and a sh
    8·1 answer
  • Convert 15 from decimal to binary. Show your work.
    14·1 answer
  • Write a function safeOpen() that takes one parameter, filename — a string giving the pathname of the file to be opened for readi
    15·1 answer
  • How do you copy and paste a screenshot on an hd computer
    12·2 answers
  • The 7-bit ASCII code for the character ‘&amp;’ is: 0100110 An odd parity check bit is now added to this code so 8 bits are trans
    12·1 answer
  • Think about some of the most memorable and forgettable games ever created. They can be games that were
    15·1 answer
  • Identify a characteristic that is a disadvantage of cloud-based hosting.
    11·1 answer
  • How do the following technologies help you with your quest to become a digital citizen kiosks enterprise computing, natural lang
    13·1 answer
  • Your network uses a network address of 137. 65. 0. 0 with a subnet mask of 255. 255. 0. 0. How many ip addresses are available t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!