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
Which parts of the forebrain are sometimes described as the “executive center” and can be likened to the central processing unit
8_murik_8 [283]

I guess the correct answer is Frontal Lobes

Thе frοntal lοbе is thе part οf thе brain that cοntrοls impοrtant cοgnitivе skills in humans, such as еmοtiοnal еxprеssiοn, prοblеm sοlving, mеmοry, languagе, judgmеnt, and sеxual bеhaviοrs. It is, in еssеncе, thе “cοntrοl panеl” οf οur pеrsοnality and οur ability tο cοmmunicatе.

6 0
3 years ago
How is the number 13,000 abbreviated in scientific notation?
Gennadij [26K]
<span> 13,000 is the same as 1.3 x 10^4</span>
3 0
3 years ago
Read 2 more answers
Why am I not getting the activation link for my account?
Alex Ar [27]
Try resending it isn't there a button to resend the email? and look in spam
4 0
3 years ago
In order to use NetWitness Investigator to analyze the same packets that you analyzed with Wireshark, you first had to save the
rusak2 [61]

Answer:

.pcap

Explanation:

He initially have to store the DemoCapturepcap.pcapng file throughout the older.pcap format in which of using NetWitness Examiner to examine a certain transmissions that the person examined with Wireshark.

PCAP should be used for the protocol analyzer, server control, traffic producer, server checker or device for detecting intrusion. It is quite user-friendly and seems to be compliant with such a large range of methods. In reality, for further over a variety of different transmission capturing methods, t is used as the platform.

5 0
3 years ago
Technician A says that using 100% coolant is better for freeze protection in an engine than a mixture with water. Technician B s
Levart [38]

Answer:

Technician B is right.

Explanation:

Generally speaking, most engines use a mixture of 50/50 coolant and water.

This is ideal in places where the weather never gets too extreme, and temperatures rarely go below 0 degrees. Using 100% antifreeze or coolant in any engine is not recommended since this doesn't have the same ability as water to transfer heat to or from the engine. Antifreeze is used to lower the freezing point of water, and it is water itself that does the job of keeping engine temperatures safe.

4 0
3 years ago
Other questions:
  • What is a bug?
    11·2 answers
  • (TCO 4) What will be the value of input_value if the value 5 is input at run time? cin &gt;&gt; input_value; if (input_value &gt
    12·1 answer
  • Rick works for the government and is investigating a small business that the government suspects has been cheating on its taxes.
    15·1 answer
  • What does expected initializer before ". " token mean?
    7·1 answer
  • Maria is an experienced programmer who has worked on different projects. she was recently promoted to be a software development
    11·2 answers
  • 41. All the following software are examples of operating systems EXCEPT
    5·1 answer
  • What is the next step Charlie should take to solve the problem
    10·2 answers
  • Would you rather be rich and unknown or famous and poor
    9·1 answer
  • What is the appropriate source to find information about an organization?
    12·1 answer
  • How to get a javascript's varible
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!