Main should Ask a user to enter a spot and then a strike usi

Main should Ask a user to enter a spot and then a strike (using cin) and then print out both the call and the put exercise value for the specified spots and strikes (using cout). The input should be doubles. Run a for loop that sets spots from 100 to 200 and prints out the call and put exercise values for a strike of 150 Run a for loop that sets strikes from 100 to 200 and prints out the call and put exercise values for a spot of 150 Use if statements to perform conditional execution: Ask a user to enter 0 or 1. If the user enters 0, then ask the user for a strike price and print the exercise value of a put with spot price $50. If the user enters 1, then ask the user for a spot price and print the exercise value for a call option with strike price $100. If the user enters something else, print out an error.

Solution

#include<iostream>
#include<iomanip>
#include<string>
#include <fstream>
using namespace std;

const int arraySize = 1000;
double price[arraySize];
int partNo[arraySize], quantity[arraySize];
string make[arraySize], partName[arraySize];

void menu();
void option(int);
void choice1();

int main()
{
int choice=0;
while (choice != 8)// condtion choice not equal 8
{

menu();//calling menu function
cin >> choice;// enter the choice
option (choice);// calling the switch funtion and send the choice
}

return 0;
}

void menu()// menu function the have the menu output only
{

cout <<\"Inventory Control System \ \ \"

<< \"\\t [1] Add part\ \"
<< \"\\t [2] Update part \ \"
<< \"\\t [3] Remove part\ \"
<< \"\\t [4] List inventory \ \"
<< \"\\t [5] Parts whose quantity < 5 \ \"
<< \"\\t [6] Parts above a given price \ \"
<< \"\\t [7] Parts above the average price \ \"
<< \"\\t [8] Stock statistics \ \ \"
<< \"\\t [9] Exit \ \ \"

<< \"Enter your choice: \";
}

void option(int x)
{
switch(x)
{
case 1 :
choice1();
break;
case 2 :
choice2();
break;
case 3 :
choice3();
break;
case 4 :
choice4();
break;
case 5 :
choice5();
break;
case 6 :
choice6();
break;
case 7 :
choice7();
break;
case 8 :
choice8();
break;
case 9 :
choice9();
break;
default :
cout<<\"Wrong choice \ \";// if the choice were wrong
}
}

 Main should Ask a user to enter a spot and then a strike (using cin) and then print out both the call and the put exercise value for the specified spots and st
 Main should Ask a user to enter a spot and then a strike (using cin) and then print out both the call and the put exercise value for the specified spots and st

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site