1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivan
4 years ago
6

1.6.6 Night out for codehs

Computers and Technology
1 answer:
Yuliya22 [10]4 years ago
5 0

Answer:

import java.util.*;

public class NightOut

{

   public static void main(String[] args)

   {

       Scanner input = new Scanner(System.in);

       double cost;

       double cost2;

       double cost3;

       double grandtotal;

       

       System.out.println("How much did dinner cost?");

       cost = input.nextDouble();

       

       System.out.println("How much is mini-golf for one person?");

       cost2 = input.nextDouble();

       

       System.out.println("How much did dessert cost?");

       cost3 = input.nextDouble();

       

       grandtotal = cost + cost2 * 2 + cost3;

       

       System.out.println("Dinner: " + cost);

       System.out.println("mini-golf: " + cost2);

       System.out.println("Dessert: " + cost3);

       System.out.println("Grand Total: " + grandtotal);

   }

}

Explanation:

You might be interested in
ask user to input a string. (assume length of input string is 1) If the string is lower case, print its upper case If the string
Helga [31]

Answer:

import java.util.*;

import java.util.Scanner;

class Main

{

public static void main(String[] args) {

System.out.println("Enter String");

Scanner sc1=new Scanner(System.in);

String s1= sc1.nextLine();

boolean b= isNumerc(s1);

if (b== true)

{

    System.out.println("Its number: Sorry");

}

else

{

boolean a=isStringUpperCas(s1);

if(a == false)

{

    System.out.println(s1.toUpperCase());

}

else

{

    System.out.println(s1.toLowerCase());

}

}

}

private static boolean isStringUpperCas(String st1){

     

     

      char[] arr = st1.toCharArray();

     

      int k =0; boolean flag=true;

      while(k<arr.length)

      {

         

          if( Character.isUpperCase( arr[k] ))

          {

              flag=true;

              k++;

          }

          else

          {

              flag=false;

              k++;

          }

         

      }

      return flag;

}

             

  public static boolean isNumerc(final String st1) {

     

      if (st1 == null || st1.length() == 0) {

          return false;

      }

      for (char ch : st1.toCharArray()) {

          if (!Character.isDigit(ch)) {

              return false;

          }

      }

      return true;

  }

 

}

Explanation:

Please find the program above.

8 0
3 years ago
The ____ area on the status bar includes six commands as well as the result of the associated calculation on the right side of t
vladimir1956 [14]
<span>Auto Calculate 

The </span>Auto Calculate <span>area on the status bar includes six commands as well as the result of the associated calculation on the right side of the menu.

Hope This Helps :)

P.S
If you would make me as brainiest that would be great! :D </span>
4 0
4 years ago
What are the advantages of repeating a header row? check all that apply
saveliy_v [14]

Edits made to the header row content will automatically be applied to all pages.

You can add and delete rows from the table without moving the header rows.

7 0
4 years ago
The way things are arranged on a publication is referred to as the _____.
MissTica
Answer: I’m pretty sure it’s layout
4 0
4 years ago
Motorcycles have two or three wheels, a seat for the rider and at least a ____ horse-powered engine.
HACTEHA [7]

depends on state laws, definitions. 'Motor Driven Cycle/motor bicycle' not allowed on interstate is less than 150cc and some places have a 15hp minimum- was Ohio minimum few years back. Motor assisted bicycle or moped in some places like New Jersey or UK has a 2 hp, 50cc upper limit with a speed restriction of 20 mph or 30 or 31 mph- if more than that it becomes a 'motorcycle'

4 0
4 years ago
Other questions:
  • Can i configure my entire network as a dmz
    6·1 answer
  • Samuel is working on decimal and binary conversion for his college project. He is using the binary number 111011 and wants to ex
    14·1 answer
  • HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol inclu
    10·1 answer
  • The _______________ is a priority-ordered list of the other carrier networks and frequencies it should search for when it cannot
    6·1 answer
  • Interview Questions for a game developer help needed
    10·1 answer
  • What will the following segment of code output? Assume the user enters a grade of 90 from the keyboard. cout &lt;&lt; "Enter a t
    5·1 answer
  • HURYYYY
    6·2 answers
  • Soft skills are: A) Personal qualities, habits, attitudes, and social graces that make up a person B) Hereditary C) The ability
    5·2 answers
  • use the internet to research the SYSTEM account. Why is it nessesary to include this account with full control on a directory
    13·1 answer
  • What does an upright (straight) body posture convey or show? [ ]
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!