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
What is an effective way to record change management? (5 points)
yanalaym [24]

Answer:

Detailed Notes

Explanation:

I took the 2.04 quiz

3 0
3 years ago
What is the numerical ratio that is equivalent to 19.2 dB?
mrs_skeptik [129]

Answer: 83.17

Explanation:

By definition, the dB is an adimensional unit, used to simplify calculations when numbers are either too big or too small, specially in telecommunications.

It applies specifically to power, and it is defined as follows:

P (dB) = 10 log₁₀ P₁ / P₂

Usually P₂ is a reference, for instance, if P₂ = 1 mW, dB is called as dBm (dB referred to 1 mW), but it is always adimensional.

In our question, we know that we have a numerical ratio, that is expressed in dB as 19.2 dB.

Applying the dB definition, we can write the following:

10 log₁₀ X = 19.2 ⇒ log₁₀ X = 19.2 / 10 = 1.92

Solving the logarithmic equation, we can compute X as follows:

X = 10^1.92  = 83.17

X = 83.17

4 0
3 years ago
Which of the following is used to allocate memory for the instance variables of an object of a class?1. the reserved word public
kodGreya [7K]

Answer:

The correct answer to the following question will be 2. the operator new.

Explanation:

New operator is used to allocating the memory to the instance object.The new object can be created by using a "new" keyword in java .

Syntax of using 'new' operator is :

class_name object_name=new class_name() // it allocated the memory to the class

For Example :

ABC obj = new ABC;  

Now, this time obj points to the object of the ABC class.

obj = new ABC ();

call the construction of ABC class

3 0
3 years ago
In which of the following locations can you edit all of the Properties of a PowerPoint file?
Lapatulllka [165]
Access the File<span> menu, choose </span>Info Pane<span> to get to </span>Backstage view, you can see Properties on t<span>he area on the right side </span>of the current PowerPoint presentation.  <span>Within the </span>Properties<span> pane click the </span>Show All Properties<span>  option , T</span><span>his will displays properties such as </span>Size<span>, the number of </span>Slides<span>,  </span>Hidden Slides<span>, the number of </span>Multimedia Clips, etc.  Some of the entries are editable w<span>ithin the  </span>Properties pane, and some are not. Just move your mouse cursor over any detail of a property. The editable sections will change the cursor into edit mode.  
6 0
3 years ago
Within a single program, __________________ allows multiple parts, or threads, to run simultaneously.
jekas [21]
<span>It should be single-user/multitasking os.</span>
4 0
3 years ago
Other questions:
  • What are six external parts of a computer
    11·1 answer
  • Which of the following is NOT a good idea to do after you change the root password?
    12·1 answer
  • How can an individual find career data?
    13·1 answer
  • If a full disk encryption (FDE) password is forgotten, what can be incorporated to securely store the encryption key to unlock t
    13·1 answer
  • Which method of accessing FTP has the most limited capabilities?
    9·2 answers
  • Write pseudocode instructions to carry out each of the following computational operations:1. Determine the area of a triangle gi
    12·1 answer
  • The most important task in developing a new computer system/app is to: a) choose the most current technologies such as operating
    5·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    9·1 answer
  • You have been supporting CSM Tech Publishing's Windows Server 2016 server network for over a year. The office has two Windows Se
    12·1 answer
  • What safety do you need to have ready to start a device repair?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!