#include<iostream> #include<string> #include<sstream> int main() { for (size_t employee=1; employee<=5; ++employee) { bool ok = false; while (!ok) { std::string input; std::cout << "Employee #" << employee << std::endl; std::cout << "Enter basic pay: "; std::getline (std::cin, input); std::stringstream ss; ss << input; double pay; if (ss >> pay) { double allowance = pay * 20 / 100; double tax = (pay-allowance) * 30 / 100; double nett = pay - tax; std::cout << "Basic pay:\t" << pay << std::endl; std::cout << "Allowance:\t" << allowance << std::endl; std::cout << "Tax:\t\t" << tax << std::endl; std::cout << "Nett:\t\t" << nett << std::endl; ok = true; } else { std::cout << "Bad input\n"; } } std::cout << std::endl; } }
#include<iostream> int main() { std::cout << "sin(1) = " << std::sin(1.0) << std::endl; std::cout << "cos(1) = " << std::cos(1.0) << std::endl; std::cout << "tan(1) = " << std::tan(1.0) << std::endl; std::cout << "asin(1) = " << std::asin(1.0) << std::endl; std::cout << "acos(1) = " << std::acos(1.0) << std::endl; std::cout << "atan(1) = " << std::atan(1.0) << std::endl; } Output: sin(1) = 0.841471 cos(1) = 0.540302 tan(1) = 1.55741 asin(1) = 1.5708 acos(1) = 0 atan(1) = 0.785398
#include<iostream> #include<vector> #include<string> std::vector<std::string> parse (const std::string& s, const char delim) { std::vector<std::string> result {}; auto start = 0U; auto end = s.find (delim); while (end != s.npos) { result.push_back (s.substr(start, end - start)); start = ++end; end = s.find (delim, start); } result.push_back (s.substr (start, s.npos - start)); return result; } std::vector<std::string> parse (const std::string& s, const std::string& delim) { std::vector<std::string> result {}; auto start = 0U; auto end = s.find (delim); while (end != s.npos) { result.push_back (s.substr(start, end - start)); start = end + delim.length(); end = s.find (delim, start); } result.push_back (s.substr (start, s.npos - start)); return result; } int main() { std::string str1 = "This is a string that will be parsed by a single-space delimiter."; std::string str2 = "This==is==a==string==that==will==be==parsed==by==equal==operator."; std::string str3 = "This string has no delimiter."; std::cout << str1 << std::endl; std::vector<std::string> v1 = parse (str1, ' '); for (auto i : v1 ) std::cout << i << std::endl; std::cout << std::endl; std::cout << str2 << std::endl; std::vector<std::string> v2 = parse (str2, "=="); for (auto i : v2 ) std::cout << i << std::endl; std::cout << std::endl; std::cout << str3 << std::endl; std::vector<std::string> v3 = parse (str3, '\\'); for (auto i : v3 ) std::cout << i << std::endl; std::cout << std::endl; }
int main() { std::string first, last; std::cout << "Enter your first name: "; std::cin >> first; std::cout << "Enter your last name: "; std::cin >> last; }
#include<iostream> #include<vector> #include<string> struct employee { std::string forename; std::string surname; std::string department; }; struct directory { std::vector<employee> v; void add_employee (const std::string&, const std::string&, const std::string&); }; void directory::add_employee (const std::string& forename, const std::string& surname, const std::string& department) { v.push_back (employee{forename, surname, department}); } int main() { std::string forename, surname, department; std::cout << "Enter employee's forename: "; std::cin >> forename; std::cout << "Enter employee's surname: "; std::cin >> surname; std::cout << "Enter employee's department: "; std::cin >> department; add_employee (forename, surname, department); }
The STD rate at Cumberland County College has dropped over the years from 40 percent down to 26 percent, but then rose again to 35 percent.
STD's usually don't prevent pregnancy. Are you trying or are just wanting to know?
Yes. No states in the US require STD testing to obtain a marriage certificate.
50% you welcome
Accuracy STD on the other hand measures precision.
you can get an std
somewhere around 0%
Because having a STD compromises the immune system which will allow the virus to transfer more easily.
an average human use how much percent of brain
Unless they break during intercourse.
#include<iostream> #include<string> #include<sstream> int main() { for (size_t employee=1; employee<=5; ++employee) { bool ok = false; while (!ok) { std::string input; std::cout << "Employee #" << employee << std::endl; std::cout << "Enter basic pay: "; std::getline (std::cin, input); std::stringstream ss; ss << input; double pay; if (ss >> pay) { double allowance = pay * 20 / 100; double tax = (pay-allowance) * 30 / 100; double nett = pay - tax; std::cout << "Basic pay:\t" << pay << std::endl; std::cout << "Allowance:\t" << allowance << std::endl; std::cout << "Tax:\t\t" << tax << std::endl; std::cout << "Nett:\t\t" << nett << std::endl; ok = true; } else { std::cout << "Bad input\n"; } } std::cout << std::endl; } }
In Los Angeles, CA 1 in 5 teenage girls have an STD. In Los Angeles, CA 1 in 5 teenage girls have an STD.