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 of the following is among the ComScore Ad Metrix Reports?
IceJOKER [234]
I think it is d but not exactly sure
6 0
2 years ago
What types of data sources could be used in a mail merge? Check all that apply.
krok68 [10]

<u>The types of data sources that could be used in a mail merge are:</u>

  1. Word tables
  2. a database
  3. an excel sheet
  4. an outlook contacts list

<u>Explanation:</u>

Mail merge allows one to send a particular document to different individuals.  It is generally used in office environment where some information is to be communicated  to a number of people. The information is attached by adding the data sources.

Mail merge comprises of joining mail and letters and pre-tended to envelopes or mailing names for mass mailings from a structure letter.

In database mail merging it is embedding it into reports, for example, letters, mailing marks, and unofficial IDs.

Tables assist you with exhibiting data in an unmistakable and sorted out way. Tables are helpful for different assignments, for example, introducing content data and numerical information.

In excel the component in Microsoft Word and Excel streamlines the way toward sending a similar report with customized changes to a few beneficiaries.

In outlook contacts, the wellspring of customized data in a bunch of Word reports, through Word's mail blend include through Word's mail merge feature.

8 0
3 years ago
Read 2 more answers
1. State the types of programming language
timama [110]

Answer:

All four questions are explained below :

Explanation:

  1. The types of programming language are: Procedural Programming Language, Functional Programming Language , Object-oriented Programming Language, Scripting Programming Language,Logic Programming Language. For example: C, C++, Java, FORTRAN, PHP language etc.
  2. Imperative language means code is executed line by line, in sequence. And declarative language means that the program itself specifies what next is to be done not how it is done.
  3. One line of 2nd generation is equivalent to one line of object code.
  4. One line of 3rd generation is equivalent to many lines of object code.
8 0
3 years ago
A common problem in record systems is inaccurate classification of records as they are created and revised. a. True b. False
Mashcka [7]

Answer:

True.

Explanation:

The whole point of keeping records is to be able to check back on them at a later time. This is why records are kept in such a way/in such an order that it would be absolutely easy to locate them when required.

Inaccurate classification defeats the whole purpose of record keeping as it makes it hard (impossible at times) to locate such record that has been mistakenly classified.

7 0
3 years ago
Write a program to enter a number and test if it is greater than 45.6.if the number entered is greater than 45.6 the program nee
Elina [12.6K]

Answer:

#include<stdio.h>                        //header file

int main()                                      //main function

{

float num;                                   // variable declaration

printf("Enter a number to test:\n");   // getting variable for test

scanf("%f", &num);

if (num>45.6)                                    //Testing weather greater or smaller

printf("\n %f is greater than 45.6", num);  // Result if greater

else

printf("\n %f is not greater than 45.6", num);  // Result if smaller or equal

return 0;

}

Explanation:

  • First of all , a variable will be declared in float (data type ).
  • User will input data in variable.
  • The variable will be compared using logical operator with 45.6
  • If it is greater, A phrase will be passed that number is greater than 45.6
  • Else if the number will not greater the phrase will say that the number is not greater than 45.6

4 0
3 years ago
Other questions:
  • 6.1.5: weather codehs
    13·1 answer
  • Changing the user name in the word application is completed through the __.
    10·2 answers
  • Is using abbreviations and symbols in social media a problem? Why or why not?
    11·1 answer
  • Jennifer frequently uses a few programs on her laptop. Where will she find all the frequently used program icons in her computer
    13·1 answer
  • Which hardware component is most suspect if a user can barely make out
    10·1 answer
  • Dawn needs to insert a macro into a Word document. Where can she find the Insert Macro dialog box?
    11·1 answer
  • Which logic gate produces an output of 1 only if both its inputs are 0
    12·2 answers
  • Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
    13·1 answer
  • What is a computer meaning
    10·1 answer
  • The words, the computer is the future, has how many bits?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!