oronarosas
New member
- Joined
- Aug 16, 2012
- Messages
- 2
- Programming Experience
- Beginner
Hey everyone Im just starting in my programming classes and am stumped on how to fix a problem. Can someone please help! Here is the project description:
This week, you need to write a program for Magic Blender company, which sells a blender for $39.95.
The program should prompt the user for the following information:
This is what I have for code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Magic_Blender
{
class Program
{
static void Main(string[] args)
{
string myName, streetAddress, city, state, zipCode;
double totalBlend, taxTotal, netDue;
int blendersOrdered;
Console.WriteLine("Enter Name: ");
myName = Console.ReadLine();
Console.WriteLine("Enter Street Address: ");
streetAddress = Console.ReadLine();
Console.WriteLine("City: ");
city = Console.ReadLine();
Console.WriteLine("State: ");
state = Console.ReadLine();
Console.WriteLine("Zip Code: ");
zipCode = Console.ReadLine();
Console.WriteLine("Enter Number of Purchased Blenders: ");
blendersOrdered = Console.ReadLine();
totalBlend = (blendersOrdered * 39.95);
taxTotal = (blendersOrdered * .07);
netDue = (totalBlend + taxTotal);
Console.WriteLine("Receipt for:");
Console.WriteLine(myName);
Console.WriteLine(streetAddress);
Console.WriteLine(city);
Console.WriteLine(state);
Console.WriteLine(zipCode);
Console.WriteLine(totalBlend + "blenders ordered @ $39.95ea. ");
Console.WriteLine("Total: $" + totalBlend);
Console.WriteLine("Tax: $" + taxTotal);
Console.WriteLine("---------------------------");
Console.WriteLine("Due: $:" + netDue);
Console.ReadLine();
So the problem is the highlighted area says " Error 1 Cannot implicitly convert type 'string' to 'int' "
Can someone please tell me where Im going wrong please. Much appreciated!
This week, you need to write a program for Magic Blender company, which sells a blender for $39.95.
The program should prompt the user for the following information:
- Name
- Street address
- City
- State
- Zip code
- Quantity of blenders ordered
- All the input data
- Amount due before tax, which is equal to the number of blenders ordered multiplied by the price of one blender
- Sales tax, which is equal to seven percent of the amount due before tax
- Net due, which is equal to the sum of amount due before tax and sales tax
This is what I have for code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Magic_Blender
{
class Program
{
static void Main(string[] args)
{
string myName, streetAddress, city, state, zipCode;
double totalBlend, taxTotal, netDue;
int blendersOrdered;
Console.WriteLine("Enter Name: ");
myName = Console.ReadLine();
Console.WriteLine("Enter Street Address: ");
streetAddress = Console.ReadLine();
Console.WriteLine("City: ");
city = Console.ReadLine();
Console.WriteLine("State: ");
state = Console.ReadLine();
Console.WriteLine("Zip Code: ");
zipCode = Console.ReadLine();
Console.WriteLine("Enter Number of Purchased Blenders: ");
blendersOrdered = Console.ReadLine();
totalBlend = (blendersOrdered * 39.95);
taxTotal = (blendersOrdered * .07);
netDue = (totalBlend + taxTotal);
Console.WriteLine("Receipt for:");
Console.WriteLine(myName);
Console.WriteLine(streetAddress);
Console.WriteLine(city);
Console.WriteLine(state);
Console.WriteLine(zipCode);
Console.WriteLine(totalBlend + "blenders ordered @ $39.95ea. ");
Console.WriteLine("Total: $" + totalBlend);
Console.WriteLine("Tax: $" + taxTotal);
Console.WriteLine("---------------------------");
Console.WriteLine("Due: $:" + netDue);
Console.ReadLine();
So the problem is the highlighted area says " Error 1 Cannot implicitly convert type 'string' to 'int' "
Can someone please tell me where Im going wrong please. Much appreciated!