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
18 days 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 [932]18 days 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
Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input.
Amiraneli [921]

Answer:

In C++:

#include <iostream>

#include <string>

#include <sstream>

using namespace std;

int main(){

   string lname, fname, stringnum;    int num; string login, pwd;

   cout<<"Last Name: ";    cin>>lname;

   cout<<"First Name: ";    cin>>fname;

   cout<<"Four-digit integer: ";    cin>>num;

   stringnum = to_string(num).substr(0, 4);

   stringstream geek(stringnum);    geek>>num;

   num = num%100;

   pwd = to_string(num);

   if(lname.length()<5){ login = lname + fname.substr(0, 1);    }

   else{ login = lname.substr(0, 5) + fname.substr(0, 1);    }

   cout<<"Login Name: "<<login<<endl;

   cout<<"Password: "<<pwd<<endl;

   return 0;

}

Explanation:

This initializes all the required variables

   string lname, fname, stringnum;    int num;     string login, pwd;

This asks the user for their last name

   cout<<"Last Name: ";    cin>>lname;

This asks for the first name of the user

   cout<<"First Name: ";    cin>>fname;

This prompts for a four-digit number

   cout<<"Four-digit integer: ";    cin>>num;

This converts the number into a string and extracts the first four digits

   stringnum = to_string(num).substr(0, 4);

This changes the string back into an integer

   stringstream geek(stringnum);    geek>>num;

This extracts the last two digits of the four-digit number

   num = num%100;

This generates the user's password

  pwd = to_string(num);

This constructs the user's login name.

This block runs if the last name has fewer than five letters

   if(lname.length()<5){ login = lname + fname.substr(0, 1);    }

This block runs otherwise

   else{ login = lname.substr(0, 5) + fname.substr(0, 1);    }

This displays the login name

   cout<<"Login Name: "<<login<<endl;

This displays the password

   cout<<"Password: "<<pwd<<endl;

3 0
1 month ago
Write a code segment to change the name of the Thing object something such that the new name consists of the old name with one c
oksian1 [797]

Answer:

import random

def name_change( name: list ) -> list :

   choice = random.choice( name )

   choice_index = name.index( choice )

   name.pop( choice_index )

   return name

Explanation:

The provided Python code utilizes the random library to randomly select an item from a list within the function "name_change". The index of the selected item is then retrieved from the list and removed from the original list called "name", with the modified name subsequently returned.

To activate the function, assign it to a variable, supply a list (it must be a list) as its argument, and then express the result.

6 0
1 month ago
if you had two proxy servers located in the same room, what use could you make of them? nothing create a hub sell one of the ser
Harlamova29_29 [932]
Establish a free wifi service
6 0
1 month ago
Read 2 more answers
FOREACH, EXPLODE and MAIL are examples of crazy functions.
zubka84 [942]
The selected response is B
4 0
1 month ago
The following is a string of ASCII characters whose bit patterns have been converted into hexadecimal for compactness: 73 F4 E5
Rzqust [894]

Answer:

a) Transforming each character into its binary equivalent:

73:

The digits are 7 and 3

7 in binary is: 111

3 in binary is: 11

Thus

73: 0_111_0011

Likewise

F4:

F stands for 15 and its binary is: 1111

4 in binary: 100

Consequently

F4:  1_111_0100

E5:

E corresponds to 14 and its binary form is: 1110

5 in binary: 101

Therefore

E5:  1_110_0101

76:

7 in binary: 111

6 in binary: 110

Hence

76:  0_111_0110

E5:

E has a binary representation of: 1110

5 in binary: 101

Consequently

E5:  1_110_0101

4A:

4 in binary: 100

A represents 10

A in binary form: 1010

Therefore

4A:  0_100_1010

EF:

E in binary is: 1110

F in binary is: 1111

Thus

EF: 1_110_1111

62:

6 in binary form: 110

2 in binary form: 10

Therefore

62:  0_110_0010

73:

The digits are 7 and 3

7 in binary is: 111

3 in binary is: 11

Thus

73: 0_111_0011

for 0_1110011: the decimal equivalent is: 115 which translates to s

for 1_1110100:  the decimal equivalent is: 116 which translates to t

for 1_1100101:  the decimal equivalent is: 101 which translates to e

for 0_1110110: the decimal equivalent is:  118 which translates to v

for 1_1100101:  the decimal equivalent is: 101 which translates to e

for 0_1001010: the decimal equivalent is:  74 which translates to j

for 1_1101111: the decimal equivalent is: 111 which translates to o

for 0_1100010:  the decimal equivalent is: 98 which translates to b

for 0_1110011: the decimal equivalent is:  115 which translates to s

Thus the decoded sequence is:  stevejobs

b) The parity being utilized is odd.

for 0_1110011:  There are 5 instances of 1s and the parity is 0 indicating it is odd.

for 1_1110100: There are 4 instances of 1s and the parity is 1 indicating it is odd.

Thus, we count the number of 1s and then verify if the parity is odd or even.

Likewise

for 1_1100101:  the parity is odd

for 0_1110110: the parity is odd

for 1_1100101:  the parity is odd

for 0_1001010: the parity is odd

for 1_1101111: the parity is odd

for 0_1100010: the parity is odd

for 0_1110011: the parity is odd

Therefore, the parity being used is odd.

5 0
16 days ago
Other questions:
  • Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
    5·1 answer
  • Which of the following statements is true regarding input and output?
    12·2 answers
  • How concerned are you about the security of rtos in cars smart homes and wearable technology?
    15·1 answer
  • Charlie has a large book collection. He was keeping track of it in a spreadsheet, but it has grown big enough that he wants to c
    10·1 answer
  • Write a loop that reads strings from standard input, where the string is either duck or goose. the loop terminates when goose is
    7·1 answer
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    15·1 answer
  • Write the definition of a function power_to, which receives two parameters. The first is a float and the second is an integer. T
    5·1 answer
  • Consider a one-way authentication technique based on asymmetric encryption: A --&gt; B: IDA B --&gt; A: R1 A --&gt; B: E(PRa, R1
    13·1 answer
  • One form of Intrusion Detection System (IDS) starts operation by generating an alert for every action. Over time, the administra
    5·1 answer
  • James is an intern in a film production company. On his first day, James’ boss, Monica, tells him, “Before anything else, let me
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!