When you're busy doing things and/or be too sick for over the phone communication
Answer:
Explanation:
#include <iostream>
using namespace std;
int costdays(int);
int costhrs(int,int);
int main()
{
int dd,hh,mm,tmph,tmpd,tmpm=0;
int pcost,mcost=0;
cout<<"Enter Parking time" << endl;
cout<<"Hours: ";
cin>>hh;
cout<<"Minutes: ";
cin>>mm;
if (mm>60)
{
tmph=mm/60;
hh+=tmph;
mm-=(tmph*60);
}
if (hh>24)
{
tmpd=hh/24;
dd+=tmpd;
hh-=(tmpd*24);
}
if ((hh>4)&&(mm>0))
{
pcost+=costdays(1);
}
else
{
mcost=costhrs(hh,mm);
}
cout<<"Total time: ";
if (dd>0)
{
cout<<dd<<"days ";
pcost+=costdays(dd);
}
pcost+=mcost;
cout<<hh<<"h "<<mm<<"mins"<<endl;
cout<<"Total Cost :"<<pcost<<"Won";
return 0;
}
int costdays(int dd)
{
return(dd*25000);
}
int costhrs(int hh,int mm)
{
int tmpm, tmp=0;
tmp=(hh*6)*1000;
tmp+=(mm/10)*1000;
tmpm=mm-((mm/10)*10);
if (tmpm>0)
{
tmp+=1000;
}
return(tmp);
}
Answer:
Code is provided in the attachment form
Explanation:
Vector Multiplication code:
Vector_multiplication.c file contains C code.
See attachment no 1 attached below
Classification of Algorithm: For creating elements in vector c of size n, number of scalar multiplications is equal to n. The size of original two vectors scales directly with the number of operations. Hence, it is classified as O(n).
Answer:
The answer is hybrid computer coz it is the combination of both analog and digital computers
Explanation:
hope it helps
good day
Answer:
The function is as follows:
void readAndConvert(){
int n; string symbol,name;
cin>>n;
cin>>symbol;
cin.ignore();
getline (cin,name);
vector<string> trades;
string trade;
for (int inps = 0; inps < n; inps++){
getline (cin,trade);
trades.push_back(trade);}
cout<<name<<" ("<<symbol<<")"<<endl;
for (int itr = 0; itr < n; itr++){
string splittrade[3]; int k = 0;
for(int j=0;j<trades.at(itr).length();j++){
splittrade[k] += trades.at(itr)[j];
if(trades.at(itr)[j] == ' '){
k++; }}
cout<<splittrade[2]<<": "<<floor(stod(splittrade[1]) * stod(splittrade[0]))<<endl; }
}
Explanation:
See attachment for complete program where comments are used to explain each line