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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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