Write an algorithm to decide which is cheaper car or bus

Assignment Help Basic Computer Science
Reference no: EM131085228

3.1 Write an Algorithm to decide which is cheaper car or bus for a travel:

You want to decide whether you should drive your car to work or take the bus. You know the one-way distance from your home to your place of work, and the fuel efficiency of your car (in miles per gallon). You also know the one-way price of a train ticket. You assume the cost of gas at $4 per gallon, and car maintenance at 5 cents per mile. Write an algorithm to decide which commute is cheaper.

3.2 Use string concatenation only to complete the following program so that it prints the message "the quick white tiger jumps over the small dog".
public class ConcatDemo
{
public static void main(String[] args)
{
String animal1 = "quick white tiger"; String animal2 = "small dog";
String article = "the"; String action = "jumps over";
/* Your work goes here */
System.out.println(message);
}
}
3.3 Find the output of the following code when the user enters 100 and when the user enters AQ:
public static void main(String[] args)
{
Scanner in = new Scanner(System.in); System.out.print("Enter somthing: "); String str = in.next();
int count = Integer.parseInt(str); System.out.println("Input is " + count);
}

Reference no: EM131085228

Questions Cloud

Calculate phono fixed asset turnover ratio : In its annual report, Phono Corporation reported beginning total assets of $360,000, ending total assets of $406,000, beginning fi xed assets of $300,000 (at cost), ending fi xed assets of $311,000 (at cost), ending accumulated depreciation of $10..
What is your prediction for the future of professionals : What is your prediction for the future of professionals in the field of justice studies? Example: Many law enforcement officers are leaving their profession for new jobs. As a result, some law enforcement agencies are offering sign-on bonuses in F..
Appropriate goals for the firm minimize the agency problem : What is agency theory? How can setting the appropriate goals for the firm minimize the agency problem? Differentiate between profit maximization and wealth maximization.
Calculate the maximum efficiency : For the class A series-fed amplifier, the maximum efficiency can be determined using the maximum voltage and current swings. Calculate this maximum efficiency.
Write an algorithm to decide which is cheaper car or bus : Write an Algorithm to decide which is cheaper car or bus for a travel:
Frequency of the current in radians per second : An 80 kHz sinusoidal voltage has zero phase angle and a maximum amplitude of 25 mV. When this voltage is applied across the terminals of a capacitor, the resulting steady state - state current has a maximum amplitude of 628.32 microamps.
Imagine two independently owned gas stations standing : 1. About 25 years ago, when Japanese companies were "eating our lunch", many analysts noted that those companies had highly leveraged capital structures -- lot's of debt and little equity. Looking at the WACC formula suggests that more debt relati..
Rms value of the sinusoidal voltage : The rms value of the sinusoidal voltage supplied to the convenience outlet of a home in Russia is 220 V. What is the maximum value of the voltage at the outlet?
How does adha contribute to public health : How does ADHA contribute to public health? Discuss one resource you found and how you could use this information as a dental hygienist. What is one fact you found about the DH workforce in the U.S.?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Convert the message into ascii (use hex notation)

Convert the following message into ASCII (use Hex notation) Easy as 1.2.3!

  How the technology creates or contributes to the problem

Choose one ethical issue arising from the use of ICT that has been reported in the press in the last one year, and discuss it in depth. Show why or how the technology creates or contributes to the problem.

  Find the after-tax rate of return

Find the after-tax rate of return for the following offshore platform equipment. The equipment, designed for special jobs, will cost $2,500, will have no salvage value, and will last 5 years. Revenue minus expensed is estimated to be $1,500 in year 1..

  In the style li b {color: blue}, b is the ____ element.

In the style li b {color: blue}, b is the ____ element.

  Determine the estimated time needed

You have just started your new job as a junior programmer at Wrigh's Design House. The Project Manager has asked you to develop a program to determine the estimated time needed to complete a design project.

  Accordance to the recommendations

Write a report in accordance to the recommendations of the links on the study desk. The word-count limit for the introduction, body and conclusion of this report is set at about 3000 words

  Web application vulnerabilities

Web Application Vulnerabilities

  How the police department will able to trace the criminals

Does firewall can protect the phishing mails to get entered into the secured environment or the local environment?

  Implement the stack and queue with a single class

Implement the stack and queue with a single class interfaces with a unique class that is derived from class LinkedDeque. i asked this question before. Please do not copy the answer. thanks

  Is there any deception involved

The investigator observes the responses of those receiving the gaze. What ethical considerations, if any, do you perceive in this field experiment? Is there any deception involved?

  How does viewing this material inform

How does viewing this material inform

  Analyze techniques for requirements determination

The specific course learning outcomes associated with this assignment are. Analyze techniques for requirements determination, collection, and organization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd