Question

In: Computer Science

I want flowchart process for this code c++ _____________________ #include<bits/stdc++.h> using namespace std; int main() {...

I want flowchart process for this code c++

_____________________

#include<bits/stdc++.h>

using namespace std;

int main()

{
char repeat = 'Y';
for (;repeat == 'Y';){

char empname[222];

float basicSalary, h_r_a, DearnessAllow, tax, netSalary;

int e_id;

cout<<"\nEmployee Name :";

cin>>empname;

cout<<"\nEmployee Id :";

cin>>e_id;

cout << "Enter Basic Salary : ";

cin >> basicSalary;

DearnessAllow = 0.30 * basicSalary;

h_r_a= 800;

switch (1)
{
case 1:
if (basicSalary <= 2,50,000)
tax = 0;
case 2:
if (basicSalary > 250000 && basicSalary <= 500000)
tax = 0.05*basicSalary;
case 3:
if (basicSalary > 500000 && basicSalary <= 1000000)
tax = (0.12)*(basicSalary - 500000) + 12500;
case 4:
if (basicSalary > 1000000)
tax = 1,12,500 + 0.30*1000000;

}

netSalary = basicSalary + DearnessAllow + h_r_a - tax;

cout<<"\nEmployee Id : "<<e_id<<endl;

cout<<"\nEmployee Name : "<<empname<<endl;

cout<<"\nBasic Salary : "<<basicSalary<<endl;

cout<<"\nHRA : "<<h_r_a<<endl;

cout<<"\nDearnessAllow : "<<DearnessAllow<<endl;

cout<<"\nTax : "<<tax<<endl;

cout<<"\nNet Salary : "<<netSalary<<endl;
cout<<"Do you want to still continue....Y/N"<<endl;
cin>>repeat;
}

return 0;

}

Solutions

Expert Solution




Related Solutions

I want Algorithim of this c++ code #include<iostream> using namespace std; int main() { char repeat...
I want Algorithim of this c++ code #include<iostream> using namespace std; int main() { char repeat = 'y'; for (;repeat == 'y';){ char emplyeename[35]; float basic_Salary,EPF, Dearness_Allow, tax, Net_Salary , emplyee_id; cout << "Enter Basic Salary : "; cin >> basic_Salary; Dearness_Allow = 0.40 * basic_Salary; switch (01) {case 1: if (basic_Salary <= 2,20,00) EPF = 0; case 2: if (basic_Salary > 28000 && basic_Salary <= 60000) EPF = 0.08*basic_Salary; case 3: if (basic_Salary > 60000 && basic_Salary <= 200000)...
write the algorithm for this the code?!. #include<iostream> using namespace std; #include<string.h> int main() { char...
write the algorithm for this the code?!. #include<iostream> using namespace std; #include<string.h> int main() { char plain[50], cipher[50]="", decrypt[50]=""; int subkeys[50], len;       cout<<"Enter the plain text:"<<endl; cin>>plain;    cout<<"Enter the first subkey:"<<endl; cin>>subkeys[0];    _strupr(plain);    len = strlen(plain);    /**********Find the subkeys**************/    for(int i=1; i<len; i++) { if ((plain[i-1]>='A') && (plain[i-1]<='Z')) { subkeys[i] = plain[i-1]-65; } }    /****************ENCRYPTION***************/       for(int i=0; i<len; i++) { if ((plain[i]>='A') && (plain[i]<='Z')) {    cipher[i] = (((plain[i]-65)+subkeys[i])%26)+65; }...
I need a Flowgorithm chart of this #include using namespace std; int main() {    float...
I need a Flowgorithm chart of this #include using namespace std; int main() {    float CISBook[] = {55.5,35.8,67.5};    float MATHBook[] = {25.5, 54.5};    float MECBook[] = {65.0,75.5,86.8};    float sumCIS=0, sumMATH = 0, sumMEC = 0;              for (int i=0; i<4; i++)    {sumCIS += CISBook[i];}       for (int i=0; i<3; i++)    {sumMATH += MATHBook[i];}       for (int i=0; i<4; i++)    {sumMEC += MECBook[i];}       cout<<"\nTotal for CIS Books:...
#include <iostream> using namespace std; int main() {     int hour;     int min;     for (hour = 1;...
#include <iostream> using namespace std; int main() {     int hour;     int min;     for (hour = 1; hour <= 12; hour++)     {         for (min = 0; min <= 59; min++)         {             cout << hour << ":" << min << "AM" << endl;         }     }       return 0; } 1.      Type in the above program as time.cpp. Add a comment to include your name and date. Compile and run. 2.      What is the bug or logic error in the above program? Add the...
#include <iostream> #include <iomanip> using namespace std; int main() {     int studentid, numberreverse[20], count =...
#include <iostream> #include <iomanip> using namespace std; int main() {     int studentid, numberreverse[20], count = 0, maximum = 0, minimum = 0;     cout << "Enter your student ID number: ";     cin >> studentid;     cout << "Student ID Number = " << studentid << endl;     while (studentid != 0)     {          numberreverse[count] = studentid % 10;          if (count == 0)          {              minimum = numberreverse[count];              maximum = minimum;          }          else...
code from assignment 1 #include #include using namespace std; const int nameLength = 20; const int...
code from assignment 1 #include #include using namespace std; const int nameLength = 20; const int stateLength = 6; const int cityLength = 20; const int streetLength = 30; int custNomber = -1; // Structure struct Customers { long customerNumber; char name[nameLength]; char state[stateLength]; char city[cityLength]; char streetAddress1[streetLength]; char streetAddress2[streetLength]; char isDeleted = 'N'; char newLine = '\n'; int zipCode; }; int main() { ofstream file; file.open("Customers.dat", fstream::binary | fstream::out); char go; long entries = 0; struct Customers data; do...
#include <iostream> #include <string> #include <fstream> #include <vector> #include <sstream> using namespace std; int main() {...
#include <iostream> #include <string> #include <fstream> #include <vector> #include <sstream> using namespace std; int main() { ifstream infile("worldpop.txt"); vector<pair<string, int>> population_directory; string line; while(getline(infile, line)){ if(line.size()>0){ stringstream ss(line); string country; int population; ss>>country; ss>>population; population_directory.push_back(make_pair(country, population)); } } cout<<"Task 1"<<endl; cout<<"Names of countries with population>=1000,000,000"<<endl; for(int i=0;i<population_directory.size();i++){ if(population_directory[i].second>=1000000000){ cout<<population_directory[i].first<<endl; } } cout<<"Names of countries with population<=1000,000"<<endl; for(int i=0;i<population_directory.size();i++){ if(population_directory[i].second<=1000000){ cout<<population_directory[i].first<<endl; } } } can u pls explain the logic behind this code up to 10 lines pls, many thanks
What is the flowchart for this code. Thank You! #include<iostream> #include<iomanip> #include<string> #include<cmath> using namespace std;...
What is the flowchart for this code. Thank You! #include<iostream> #include<iomanip> #include<string> #include<cmath> using namespace std; float series(float r[], int n) {    float sum = 0;    int i;    for (i = 0; i < n; i++)        sum += r[i];    return sum; } float parallel(float r[], int n) {    float sum = 0;    int i;    for (i = 0; i < n; i++)        sum = sum + (1 / r[i]);...
#include <string> using namespace std; //using recursion no loops allowed int main() { double nums[] =...
#include <string> using namespace std; //using recursion no loops allowed int main() { double nums[] = { 13.8, 2.14, 51, 82, 3.14, 1.7, 4.89, 18, 5, 23.6, 17, 48, 5.6 };   //Challenge #2: print the list from given range   printList(nums, 0, 12); //13.8 2.14 51 .... 48 5.6   cout << endl;   //Challenge #3: print the list, but backwards   printReverse(nums, 0, 12); //5.6 48 17 ... 2.14 13.8   cout << endl;                  //Challenge #4: reverse order of items in list   reverse(nums,...
C++ I took 7/20 =( code: #include <iostream> #include<string.h> using namespace std; // function to calculate...
C++ I took 7/20 =( code: #include <iostream> #include<string.h> using namespace std; // function to calculate number non white space characters int GetNumOfNonWSCharacters(string str) { int i = 0; int count = 0; while(str[i] != '\0') { if(str[i] != ' ') { count += 1; } i++; } return count; } // function to calculate numbers of words int GetNumOfWords(string str) { int i = 0; int count = 1; while(str[i] != '\0') { if(str[i] == ' ' && str[i-1]...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT