Professional Documents
Culture Documents
BCS231095
QUIZ 8
QUESTION 1:
CODE 1:
#include <iostream>
using namespace std;
int main()
{
double purchasePrice, taxRate;
cout << "Enter the purchase price: ";
cin >> purchasePrice;
cout << "Enter the tax rate: ";
cin >> taxRate;
return 0;
}
OUTPUT:
QUESTION 2:
CODE 2:
#include <iostream>
using namespace std;
void printDiamond(int& n) {
int i, j, space;
int main() {
int size;
cout << "Enter the size of the diamond: ";
cin >> size;
printDiamond(size);
return 0;
}
OUTPUT: