Essay

Submitted by: Submitted by

Views: 190

Words: 361

Pages: 2

Category: Science and Technology

Date Submitted: 08/24/2012 07:50 PM

Report This Essay

Write a program that takes user input that places $ in the input into a file. Write another file that has many words as there are inputs. Replace the $ in the text file with the words and write that to a separate file. Please write out the complete code in java

This program should create three seperate Java files.

1. One that user inputs with $

2. One with the words that the $ are replaced with.

3. One with the $ replaced.

The code must be written in java

ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Begin:

Console.Write("Enter Your First Name: ");

string FirstName = Convert.ToString(Console.ReadLine());

Console.WriteLine();

Console.Write("Enter Your Last Name: ");

string LastName = Convert.ToString(Console.ReadLine());

Console.WriteLine();

Console.Write("Enter Your Street Address: ");

string StreetAddress = Console.ReadLine();

Console.WriteLine();

Console.Write("Enter Your Zip Code: ");

int ZipCode = Convert.ToInt32(Console.ReadLine());

Console.WriteLine();

Console.Write("Enter The quantity of blenders at $39.95: ");

int Blenders = Convert.ToInt32(Console.ReadLine());

Console.Write("Is this information correct?: ");

string NO = Convert.ToString(Console.ReadLine());//Note I dont know if this is how its suppose to be

string No = Convert.ToString(Console.ReadLine());

string no = Convert.ToString(Console.ReadLine());

if(NO) //Cannot implicitly convert type 'string' to 'bool'

{

Console.Write("Please Re-Enter information: ");

goto Begin;

}

string YES = Convert.ToString(Console.ReadLine());

string Yes = Convert.ToString(Console.ReadLine());

string yes = Convert.ToString(Console.ReadLine());

if (Yes)//Error 1 Cannot implicitly convert type 'string' to 'bool' is the error I get

{

Console.Write("Please Re-Enter information: ");

goto Continue;

}

Console.Write("-------------------------------------------------------------------------------");// this was added for looks

Continue:...