ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 May 2017 My Price 8.00

the dollar amount of sales made

Issues with my code C#

Program must display the output as follows:

Sales: *the dollar amount of sales made*

Profit Ratio: * the % of profit*

Net Proceeds: *The amount of profit bases on the sales amount*

The Code follows:

using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter5Program2
{
    class Ch5Program2
    {
        static void Main(string[] args)
        {
            double sales;
            double profit;
            double pr;
            double p;

            //Decimal data tyoe Date Member

            decimal profitratio;

            //Get the input data from the user

            Write("Please enter sales amount: ");

            sales = Convert.ToDouble(ReadLine());

            //Checking the sales range
            //According to this, the profit is caculated

            if (sales <= 1000)
            {
                profitratio = 0.03m;
                //Explicit conversion of dedcimal to double
                pr = (double)profitratio;
                //Calculation of profit
                profit = sales * pr;
                p = pr * 100;
            }

            else if (sales > 1000 && sales <= 5000)
            {
                profitratio = 0.035m;
                pr = (double)profitratio;
                profit = sales * pr;
                p = pr * 100;
            }

            else if (sales > 5000 && sales <= 10000)
            {
                profitratio = 0.04m;
                pr = (double)profitratio;
                profit = sales * pr;
                p = pr * 100;
            }

            else if (sales > 10000)
            {
                profitratio = 0.045m;
                pr = (double)profitratio;
                profit = sales * pr;
                p = pr * 100;
            }

            WriteLine("Sales: $" + sales);
         /*will not display at code is written
          *  
          *   WriteLine("Profit Ratio: " + pr);
            WriteLine("Net Proceeds: " + p +"%");
            */
        }
    }
}

Answers

(11)
Status NEW Posted 02 May 2017 06:05 AM My Price 8.00

-----------

Not Rated(0)