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
Consider the following code segment: try : inputFile = open("lyrics.txt", "r") line = inputFile.readline() print(line) _________
aleksandrvk [35]

Answer:

The answer is "except IOError:"

Explanation:

It is part of the exception handling, that stands for input/ output operation fails, this exception aeries when we attempting to access an anti-existent file, in the program so, it will give the program related errors.

  • This type of error is handled in the try block, it also allows you to prepare the deal with the exceptional block.  
  • It also helps you to hide the bugs by using code, if you handle an unexpected error.
6 0
3 years ago
A malicious user in your organization was able to use the Trinity Rescue Kit to change the password on a department manager's co
netineya [11]

Answer:

The answer is "The PC should be kept in a physically secure location".

Explanation:

In general, malicious users are hackers as well as malicious users. This user indicates that even a rogue worker, contractor, student, and another consumer who uses his sensitive rights is indeed a common word of violation of information in security circles and the headlines, and to manage the data from the theft the system should be on the physically secure location, that refers to any place, a room or a group of room within facilities of physical or staff security protocols that are sufficient to support the AI-based on LEIN and related Is a physically safe room.

7 0
3 years ago
Write a loop that fills a list values with ten random numbers between 1 and 100. Write code for two nested loops that fill value
Alex787 [66]

Answer:

Please look for your answer on Stack Overflow, it's way better.

Explanation:

4 0
2 years ago
5 potential Challenges of Collaborative Tools
Mice21 [21]

You have most probably used some variation of collaboration tools like Slack, Basecamp, and Trello at some office gig. Working within a few of these tools might sometimes have a lot of problems.

1. Forced collaboration on Employees.

Some companies may sometimes fail to notice that some employees do not want to constantly have real-time notifications popping up every minute. They may fail to recognize what is important and what is not and end up wasting money on these tools.

2. The roll-out

These tools might represent awesome business productivity growth but sadly, a huge portion of the employees will be like, what is this? If management decides to use collaboration tools, they should explain what they are and the purpose of using them.  

3. Lack of User Training.

Organizations that do not offer strong training programs for these tools can see problems arise very quickly. This could help gain insight on whether or not employees want to collaborate in the first place.

4. The “reduction in email” argument

People might positively accept these tools and become a bit connected. However, the downside to it is that, whenever something big is due, everyone falls back to email. Users need to seriously use these tools  across a variety of contexts.  

5. The overloading of documents and files.

If collaboration tools are rolled out for the sake of process documents and burdensome tracking sheets, people might head right back to their email and full meeting schedules and collaboration will die in the flood.  

5 0
3 years ago
________ is the type of security loss that involves computer criminals invading a computer system and replacing legitimate progr
Natasha2012 [34]

Answer:

Usurpation

Explanation:

In context of CIBS-210 it is known as Usurpation

6 0
3 years ago
Other questions:
  • You have just driven to the Hewlett-Packard site in Corvallis to field-interview a programmer. You sit down in a conference room
    6·1 answer
  • What did I do wrong? May you please correct it for me...I was also looking on how to delay when it prints. Like when it prints a
    9·1 answer
  • . In many instances an IP address is used to access a server rather than a URL because a URL is more difficult to set up and eas
    10·1 answer
  • What is a Network It’s a system that is used to link two or more computers and name the different types of networks.?
    11·1 answer
  • Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics
    12·1 answer
  • Which of the following guidelines about the subject line of e-mail messages is most appropriate?
    15·2 answers
  • Difference between academic library and school Library
    5·1 answer
  • What is the correct way to write h1 tag
    12·1 answer
  • Which type of network consists of multiple Windows computers that share information, but no computer on the network serves as an
    15·1 answer
  • B) What is system software? Write its importance.​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!