Answer:
//C++ code for the cash register..
#include <iostream>
#include<vector> //including vector library
using namespace std;
int main() {
vector<float> cash; //declaring a vector of type float.
float item=2,cash_sum=0;
int counter=1;
while(item!=0)//inserting prices in the vector until user enters 0...
{
cout<<"Enter the price of item "<<counter<<" :"<<endl;
cin>>item;
counter++;
cash.push_back(item);//inserting element in the vector...
}
for(int i=0;i<cash.size();i++)//looping over the vector...
{
cash_sum+=cash[i];//summing each element..
}
cash_sum*=1.08;//adding 8% sales tax.
cout<<cash_sum;//printing the result....
return 0;
}
Explanation:
I have taken a vector of type float.
Inserting the price of each item in the vector until user enters 0.
Iterating over the vector for performing the sum operation.
Then after that adding 8% sales tax to the sum.
Printing the output at last.
Answer:
The program code is at explaination
Explanation:
Below is the Python Function;
def check_halves(s):
# exact half not possible condition
if len(s)%2!=0:
return 0
halflen=len(s)//2
s1=s[:halflen]
s2=s[halflen:]
#null string condition
if len(s1)==0 or len(s2)==0:
return 0
#checking 1st digit of string recursively
if s1[0]==s2[0]:
return 1+check_halves(s1[1:]+s2[1:])
else:
return 0
You will find the input and output ad attachment.
Answer:
Achievement; date Person Achievement
1944 Aiken, Howard Conceived and codesigned the Harvard Mark I
1966 Böhm, Corrado Theorized of the concept of structured programming
1947 Booth, Kathleen Invented the first assembly language
Explanation:
Answer:
I. User manuals contain text and images to describe how to use the program features.
II. User manuals explain the commands and syntax of programming languages.
III. User manuals often include chapter on problems and their resolutions.
Explanation:
A user manual can be defined as a clear, detailed and an informative guide drafted by the manufacturer (producer) of a product or service, which is to be given to a customer (end user) so as to help them know and understand how to use the product or service properly.
User manuals are important because they contain the following necessary informations;
I. User manuals contain text and images to describe how to use the program features.
II. User manuals explain the commands and syntax of programming languages.
III. User manuals often include chapter on problems and their resolutions.
Additionally, a user manual contains information on the safety precautions that are to be taken by the end user while using a product or service.