answer.
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
hram777
2 months ago
7

Sara is writing a program to input her monthly phone bills and output the month name and amount for the month with maximum amoun

t. She has defined an array to hold the month names. Complete the pseudocode program. [6] # Program to output maximum month's phone bill MonthName ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] # Define an array to hold the phone bills for each month

Computers and Technology
1 answer:
Harlamova29_29 [1K]2 months ago
3 0

Response:

double [] phoneBills = new double[12];

Clarification:

The task specifies that an array for storing phone bills per month must be created. The declaration above sets up an array capable of holding double-precision floating point numbers, intended to represent the twelve months from January through December

Values can be populated in the array as illustrated in the program below.

public class PhoneBill {

   public static void main(String[] args) {

   String []  MonthName = {"January", "February", "March", "April", "May", "June", "July", "August",

           "September", "October", "November", "December"};

   double [] phoneBills = new double[12];

       phoneBills[0] = 4.5;

       phoneBills[1] = 4.5;

       phoneBills[2] = 5.5;

       phoneBills[3] = 6.5;

       phoneBills[4] = 3.5;

       phoneBills[5] = 5.5;

       phoneBills[6] = 6.5;

       phoneBills[7] = 7.5;

       phoneBills[8] = 8.5;

       phoneBills[9] = 4.5;

       phoneBills[10] = 3.5;

       phoneBills[11] = 7.5;

       System.out.println("Months and corresponding phone bill");

       System.out.println(Arrays.toString(MonthName));

       System.out.println(Arrays.toString(phoneBills));

   }

}

The program's output is provided below:

You might be interested in
CodeLab Question
Rzqust [1037]

Response:

I am not familiar with coding languages, but I can demonstrate how you might do it in Python

myAlarm():

   arm = True

   code = "secret message"

myAlarm()

main():

deactivate = input(">>> ")

if deactivate = myAlarm.code:

  arm = False

I still feel a bit unclear about the question.

(I work as a game developer and code daily)

3 0
2 months ago
Write a method, isEmailAddress, that is passed a String argument. It returns true or false depending on whether the argument has
Amiraneli [1052]

Answer:

//This method takes a parameter called myString of type String

public static boolean isEmailAddress (String myString){

//verifying if the @ character exists in the string

if (myString.indexOf("@")!= -1) {

  //ensuring that only a single instance of @ appears in the string

   if (myString.indexOf("@") == myString.lastIndexOf("@")) {

   //confirming absence of space characters

  if (myString.indexOf(" ") == -1) {

    //checking for the absence of newline characters in the string

    if (myString.indexOf("\n") == -1) {

      //checking for absence of tab characters in the string

      if (myString.indexOf("\t") == -1) {

          return true;

      }

    }

  }

}

}

 return false;

}

Explanation:

The method takes a string presumed to be an email address and verifies whether it is valid, returning true if it is valid and false otherwise. The method checks the following conditions:

->The presence of the "@" character

->Only one occurrence of "@" exists in the string

->No spaces present

->No newline characters present

->No tab characters present

Returning true only if all these conditions are met.

8 0
2 months ago
Assume a machine during its initial testing phase produces 10 widgets a day. After 10 days of testing (starting on day 11), it b
Harlamova29_29 [1022]

Response:

Python Code:

n = int(input("Days: "))

total = 0

for i in range(1,n+1):

     if i <= 10:

           total += 10

     elif i <= 60:

           total += 40

     elif i <= 99:

           total += 100 - i

print(str(total)+ " widgets")

Clarification:

This line requests user input for the number of days.

n = int(input("Days: "))

This line sets the initial total number of widgets to zero.

total = 0

The subsequent loop calculates total widgets based on the established rules.

for i in range(1,n+1):

     if i <= 10: -> Applies when days are 10 or fewer

           total += 10

     elif i <= 60: -> Applies when days are between 11 and 60

           total += 40

     elif i <= 99: -> Applies when days are under 100

           total += 100 - i

This line outputs the total count.

print(str(total)+ " widgets")

4 0
2 months ago
Declare a constant named YEAR, and initialize YEAR with the value 2050. Edit the statement myNewAge = myCurrentAge + (2050 − cur
amid [951]

Answer:

The following changes will be implemented to the source code

const int YEAR = 2050;

cout << "I will be " << myNewAge << " in "<<YEAR<<"." << endl;

Explanation:

First, YEAR needs to be defined as a constant integer. This is represented as follows;

const int YEAR = 2050;

This allows us to refer to YEAR throughout the program

Next,

Substitute the following:

cout << "I will be " << myNewAge << " in 2050." << endl;

with

cout << "I will be " << myNewAge << " in "<<YEAR<<"." << endl;

The revised source file is attached;

Download cpp
7 0
2 months ago
A regional trucking company landed a contract to supply products for a major retailer. To do this, it needs to hire an IT profes
zubka84 [1067]
I believe the answers are F and A
.
8 0
2 months ago
Other questions:
  • Compute the approximate acceleration of gravity for an object above the earth's surface, assigning accel gravity with the result
    13·1 answer
  • A have a string, called "joshs_diary", that is huge (there was a lot of drama in middle school). But I don't want every one to k
    5·1 answer
  • Some early computers protected the operating system by placing it in a memory partition that could not be modified by either the
    5·1 answer
  • The following code is intended to test if x is NOT less than 17. Fill in the correct symbol:
    14·2 answers
  • Which selections are possible for controlling the start time of audio playback? Check all that apply. Automatic Rewind when done
    10·1 answer
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • This assignment is based on Exercise 8.4 from your textbook. Each of the following Python functions is supposed to check whether
    11·1 answer
  • PriQueue inherits from Queue. In the implementation of the getMax() method in the PriQueue class, we need to read and write the
    5·1 answer
  • Ellen is expecting to get a 3% raise next year. She enters .03 in cell D2 so that she can predict her monthly income for the nex
    12·1 answer
  • Stan’s assignment is to print a three-dimensional image on a piece of paper. Which printing technique should he use?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!