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
Alex Ar [27]
4 years ago
10

Complete this code in main to perform the requested operations for a date entered by the user in this format: month dd, yyyy

Computers and Technology
1 answer:
SSSSS [86.1K]4 years ago
7 0

Answer:

a) System.out.println(date.charAt(0));

b)System. out.println(date.toLowerCase() );

Explanation:

a) The first letter of the string is found at the index 0. A character in the String can be extracted using the String method called charAt( ) which takes the index of the character in the String as an argument. To print it out, we use the println method. That is:

System.out.println(date.charAt(0) );

b) To covert a String to lowercase, we use the toLowerCase method.

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

You might be interested in
C++
Sonbull [250]

Answer:

#include <iostream>

#include<iomanip>

using namespace std;

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon)

{

  double dollarCost = 0;

  dollarCost = (dollarsPerGallon * drivenMiles) / milesPerGallon;

  return dollarCost;

}

int main()

{

  double miles = 0;

  double dollars = 0;

  cout << "Enter miles per Gallon   : ";

  cin >> miles;

  cout << "Enter dollars per Gallon: ";

  cin >> dollars;

  cout << fixed << setprecision(2);

  cout << endl;

  cout << "Gas cost for 10 miles : " << DrivingCost(10, miles, dollars) << endl;

  cout << "Gas cost for 50 miles : " <<DrivingCost(50, miles, dollars) << endl;

  cout << "Gas cost for 400 miles: "<<DrivingCost(400, miles, dollars) << endl;

  return 0;

}

Explanation:

  • Create a method definition of DrivingCost that accepts  three input double data type parameters drivenMiles,  milesPerGallon, and dollarsPerGallon and returns  the dollar cost to drive those miles .
  • Calculate total dollar cost and store in the variable, dollarCost .
  • Prompt and read the miles and dollars per gallon  as input from the user .
  • Call the DrivingCost function three times  for the output to the gas cost for 10 miles,  50 miles, and 400 miles.

 

8 0
3 years ago
Read 2 more answers
You find a list of numbers on the kitchen counter, but you aren’t sure what the numbers represent. This is an example of:
Pie

Answer:

I say that this would be data. It is the one that makes the most sense, because in math, that would be the data that you may not know what to do with....YET!! Hope this was helpful!

8 0
3 years ago
Read 2 more answers
A ____________ is a set of commands which can be run by calling it by name.
Bogdan [553]

Answer:

A Processor

Explanation:

6 0
3 years ago
Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
elena-s [515]

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

5 0
3 years ago
Question 5 of 5
Archy [21]

<u>Answer:</u>

<em>Sewage treatment Programs </em>

<u>Explanation:</u>

Sewage treatment programs are the right choice <em>because these are the source to create germs and if we understand how to be clean, most of the disease is avoided. </em>

<em>Drug regulation:</em> It is nothing but the continuous treatment of prolonged disease where pills needs to be taken regularly to protect patients from death or to avoid disease become more severe.

<em>Physical fitness campaign:</em> This concentrate on to how to keep bod fit through exercise and it does not deal with hygiene.

<em>Nutrition Education:</em> It’s a kind of protection mechanism where in-take of food is really concentrated to fight against germs.

5 0
4 years ago
Other questions:
  • A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the en
    14·1 answer
  • On a hard disk each track is divided into invisible wedge-shaped sections called _______
    15·1 answer
  • By using the internet, your company can obtain discounts thorugh...
    15·2 answers
  • Larry finds it easy to run legacy programs and applications in a virtualized environment. how does the virtualization provider m
    7·2 answers
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • Which of these is a major mobile game developer?
    9·1 answer
  • Lifelong learning _____. is only important for professionals with advanced degrees can be formal or informal includes formal cla
    12·1 answer
  • Select the correct text in the passage.
    12·1 answer
  • ASAP NEED HELP ASAP NEED HELP ASAP NEED HELP ASAP NEED HELP ASAP NEED HELP ASAP NEED HELP ASAP NEED HELP ASAP NEED HELP​
    6·2 answers
  • 60 points!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!