Code:

#include <stdlib.h> #include <stdio.h> #include <string.h> void main() { //First Stock char stockOne[10]; char stockCompare[10] = "Clippers"; int numberShares; float priceShare; float currentPrice; float yearlyFees; fflush(stdin); printf("Hello!

"); printf("Please enter the first stock's name

"); //This is just a joke gets(stockOne); if(strncmp (stockOne,stockCompare,10) == 0) { printf("\tClippers suck"); printf("

"); } printf("Please enter the Number of Shares for this stock

"); scanf("%d", &numberShares); printf("Please enter the Buying Price Per Share

"); scanf("%f", &priceShare); printf("Please enter the Current Price Per Share

"); scanf("%f", ¤tPrice); printf("Please enter the Yearly Fees

"); scanf("%f", &yearlyFees); float intCost, currentCost, Profit; intCost = (float) numberShares * priceShare; currentCost = (float) numberShares * currentPrice; Profit = currentCost - intCost - yearlyFees; printf("Your stock name is %s

", stockOne); printf("\tYour Initial cost is $%0.2f

", intCost); printf("\t\tYour Current cost is $%0.2f

", currentCost); printf("\t\t\tAnd your Profit is $%0.2f

", Profit); printf("

"); printf("Good job! "); //Second Stock char stockTwo[10]; char stockCompare2[10] = "Clippers"; int numberShares2; float priceShare2; float currentPrice2; float yearlyFees2; fflush(stdin); printf("Please enter the second stock's name

"); //This is just a joke gets(stockTwo); if(strncmp (stockTwo,stockCompare2,10) == 0) { printf("\tClippers suck

"); printf("

"); } printf("Please enter the Number of Shares for this stock

"); scanf("%d", &numberShares2); printf("Please enter the Buying Price Per Share

"); scanf("%f", &priceShare2); printf("Please enter the Current Price Per Share

"); scanf("%f", ¤tPrice2); printf("Please enter the Yearly Fees

"); scanf("%f", &yearlyFees2); float intCost2, currentCost2, Profit2; intCost2 = (float) numberShares2 * priceShare2; currentCost2 = (float) numberShares2 * currentPrice2; Profit2 = currentCost2 - intCost2 - yearlyFees2; printf("Your stock name is %s

", stockTwo); printf("\tYour Initial cost is $%0.2f

", intCost2); printf("\t\tYour Current cost is $%0.2f

", currentCost2); printf("\t\t\tAnd your Profit is $%0.2f

", Profit2); printf("

"); printf("Good job! "); //Third Stock char stockThree[10]; char stockCompare3[10] = "Clippers"; int numberShares3; float priceShare3; float currentPrice3; float yearlyFees3; fflush(stdin); printf("Please enter the third stock's name

"); //This is just a joke gets(stockThree); if(strncmp (stockThree,stockCompare3,10) == 0) { printf("\tClippers suck

"); printf("

"); } printf("Please enter the Number of Shares for this stock

"); scanf("%d", &numberShares3); printf("Please enter the Buying Price Per Share

"); scanf("%f", &priceShare3); printf("Please enter the Current Price Per Share

"); scanf("%f", ¤tPrice3); printf("Please enter the Yearly Fees

"); scanf("%f", &yearlyFees3); float intCost3, currentCost3, Profit3; intCost3 = (float) numberShares3 * priceShare3; currentCost3 = (float) numberShares3 * currentPrice3; Profit3 = currentCost3 - intCost3 - yearlyFees3; printf("Your stock name is %s

", stockThree); printf("\tYour Initial cost is $%0.2f

", intCost3); printf("\t\tYour Current cost is $%0.2f

", currentCost3); printf("\t\t\tAnd your Profit is $%0.2f

", Profit3); printf("

"); printf("Good job! "); //Four Stock char stockFour[10]; char stockCompare4[10] = "Clippers"; int numberShares4; float priceShare4; float currentPrice4; float yearlyFees4; fflush(stdin); printf("Please enter the fourth stock's name

"); //This is just a joke gets(stockFour); if(strncmp (stockFour,stockCompare4,10) == 0) { printf("\tClippers suck

"); printf("

"); } printf("Please enter the Number of Shares for this stock

"); scanf("%d", &numberShares4); printf("Please enter the Buying Price Per Share

"); scanf("%f", &priceShare4); printf("Please enter the Current Price Per Share

"); scanf("%f", ¤tPrice4); printf("Please enter the Yearly Fees

"); scanf("%f", &yearlyFees4); float intCost4, currentCost4, Profit4; intCost4 = (float) numberShares4 * priceShare4; currentCost4 = (float) numberShares4 * currentPrice4; Profit4 = currentCost4 - intCost4 - yearlyFees4; printf("Your stock name is %s

", stockFour); printf("\tYour Initial cost is $%0.2f

", intCost4); printf("\t\tYour Current cost is $%0.2f

", currentCost4); printf("\t\t\tAnd your Profit is $%0.2f

", Profit4); printf("

"); printf("Good job! "); //Fifth Stock char stockFive[10]; char stockCompare5[10] = "Clippers"; int numberShares5; float priceShare5; float currentPrice5; float yearlyFees5; fflush(stdin); printf("Please enter the fifth stock's name

"); //This is just a joke gets(stockFive); if(strncmp (stockFive,stockCompare5,10) == 0) { printf("\tClippers suck

"); printf("

"); } printf("Please enter the Number of Shares for this stock

"); scanf("%d", &numberShares5); printf("Please enter the Buying Price Per Share

"); scanf("%f", &priceShare5); printf("Please enter the Current Price Per Share

"); scanf("%f", ¤tPrice5); printf("Please enter the Yearly Fees

"); scanf("%f", &yearlyFees5); float intCost5, currentCost5, Profit5; intCost5 = (float) numberShares5 * priceShare5; currentCost5 = (float) numberShares5 * currentPrice5; Profit5 = currentCost5 - intCost5 - yearlyFees5; printf("Your stock name is %s

", stockFive); printf("\tYour Initial cost is $%0.2f

", intCost5); printf("\t\tYour Current cost is $%0.2f

", currentCost5); printf("\t\t\tAnd your Profit is $%0.2f

", Profit5); printf("

"); printf("Good job! "); printf("

"); float totalProfit; totalProfit = Profit + Profit2 + Profit3 + Profit4 + Profit5; printf("Your total profit is $0.2%f

", totalProfit); printf("Have a nice day!

"); system("PAUSE"); } /*************************************************** Output Hello! Please enter the first stock's name Clippers Clippers suck Please enter the Number of Shares for this stock 150 Please enter the Buying Price Per Share 1.33 Please enter the Current Price Per Share 3.33 Please enter the Yearly Fees 5.00 Your stock name is Clippers Your Initial cost is $199.50 Your Current cost is $499.50 And your Profit is $295.00 Good job! Please enter the second stock's name Spurs Please enter the Number of Shares for this stock 215 Please enter the Buying Price Per Share 15.77 Please enter the Current Price Per Share 14.25 Please enter the Yearly Fees 3.50 Your stock name is Spurs Your Initial cost is $3390.55 Your Current cost is $3063.75 And your Profit is $-330.30 Good job! Please enter the third stock's name Lakers Please enter the Number of Shares for this stock 355 Please enter the Buying Price Per Share 25.55 Please enter the Current Price Per Share 35.75 Please enter the Yearly Fees 12.25 Your stock name is Lakers Your Initial cost is $9070.25 Your Current cost is $12691.25 And your Profit is $3608.75 Good job! Please enter the fourth stock's name Celtics Please enter the Number of Shares for this stock 75 Please enter the Buying Price Per Share 12.34 Please enter the Current Price Per Share 12.34 Please enter the Yearly Fees 6.00 Your stock name is Celtics Your Initial cost is $925.50 Your Current cost is $925.50 And your Profit is $-6.00 Good job! Please enter the fifth stock's name Suns Please enter the Number of Shares for this stock 50 Please enter the Buying Price Per Share 12.36 Please enter the Current Price Per Share 10.86 Please enter the Yearly Fees 1.50 Your stock name is Suns Your Initial cost is $618.00 Your Current cost is $543.00 And your Profit is $-76.50 Good job! Your total profit is $3490.94 Have a nice day! Press any key to continue . . . ***************************************************/