Amanda indicates that she wants to do some advertising to make people in the local area aware of the development, but she admits that her advertising budget is limited, so she wants to spend her advertising dollars wisely by reaching her target audience -- adults age 55+.She asks you for your recommendations on the following advertising media. Which of the following advertising media would you recommend as being most useful in promoting Act Two Retirement Community to the target market?

Television
Radio
AARP Magazine
Direct mail

Answers

Answer 1

Answer:

Either Radio or AARP Magazine

Explanation:

Given the clue that Amanda's audience is aimed towards adults aged 55+, they were born before online mail and televisions were big on the market. Many seniors enjoy reading daily news papers while others enjoy getting their news from an audio channel like the radio.

Answer 2

To effectively promote Act Two Retirement Community to the target market of adults aged 55+, I would recommend focusing on advertising media that resonate with this demographic and offer cost-effective ways to reach them.

Among the options provided:

AARP Magazine: This publication is specifically tailored to the 50+ age group and offers a highly targeted platform to reach the desired audience. It provides an opportunity to showcase the retirement community's features and benefits in detail.

Direct Mail: Direct mail can be an effective way to reach the target audience directly in their homes. It allows for personalized, detailed information about the retirement community, making it suitable for a demographic that appreciates tangible information.

Read more about adverts here:

https://brainly.com/question/14227079

#SPJ3


Related Questions

//Add you starting comment block public class BubbleBubbleStarter //Replace the word Starter with your initials { public static void main (String[] args) { //Task 1: create an input double array list named mylist with some values pSystem.out.println("My list before sorting is: "); //Task 2: print the original list //Use println() to start and then replace with your printList() method after Task 4a is completed. p//Task 3: call the bubblesort method for mylist p//Task 4b: print the sorted list p} //Task 4a: create a method header named printlist to accept a formal parameter of a double array //create a method body to step through each array element println each element p//printList method header p//for loop p//println statement static void bubbleSort(double[] list) { boolean changed = true; do { changed = false; for (int j = 0; j < list.length - 1; j++) if (list[j] > list[j+1]) { //swap list[j] with list[j+1] double temp = list[j]; list[j] = list[j + 1]; list[j + 1] = temp; changed = true; } } while (changed); } }

Answers

Answer:

See explaination

Explanation:

import java.util.Scanner;

public class BubbleBubbleStarter {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

double arr[] = new double[10];

System.out.println("Enter 10 GPA values: ");

for (int i = 0; i < 10; i++)

arr[i] = sc.nextDouble();

sc.close();

System.out.println("My list before sorting is: ");

printlist(arr);

bubbleSort(arr);

System.out.println("My list after sorting is: ");

printlist(arr);

}

static void bubbleSort(double[] list) {

boolean changed = true;

do {

changed = false;

for (int j = 0; j < list.length - 1; j++) {

if (list[j] > list[j + 1]) {

double temp = list[j];

list[j] = list[j + 1];

list[j + 1] = temp;

changed = true;

}

}

} while (changed);

}

static void printlist(double list[]) {

for (int j = 0; j < list.length; j++) {

System.out.println(list[j]);

}

}

}

You are working with a MySQL installation in Windows. You plan to use the mysql client utility in batch mode to run a query that has been saved to a file in the C:\mysql_files directory. The name of the file is users.sql, and it includes a command to use the mysql database, which the query targets. You want to save the results of the query to a file named users.txt, which should also be saved to the C:\mysql_files directory. What command should you use to execute the query

Answers

Answer:

mysql -t < c:\mysql_files\users.sql > c:\mysql_files\users.txt

Explanation:

MySQL is a system software that is written in programming language such as c++ and c, the software was initially released on the 23rd day of the month of May, in the year 1995 by Oracle corporation. It is a popular software in companies that are commerce related or orientated since it deals with things related to web database.

So, to answer the question we are given that the file that will results of the query is users.txt and the directory is C:\mysql_files, therefore, the command that should you use to execute the query is; mysql -t < c:\mysql_files\users.sql > c:\mysql_files\users.txt

(1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-specified triangle_char character. (1 pt) (2) Modify the program to use a loop to output a right triangle of height triangle_height. The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches triangle_height. Output a space after each user-specified character, including a line's last user-specified character. (2 pts) Example output for triangle_char = % and triangle_height = 5:

Answers

Answer:

Following are the code to this question can be described as follows:

c= input('Input triangle_char: ') #defining variable c that input character value  

length = int(input('Enter triangle_height: ')) # Enter total height of triangle

for i in range(length): # loop for column values

   for j in range(i+1): #loop to print row values

       print(c,end=' ') #print value  

   print()# for new line

Output:

please find the attachment.

Explanation:

In the above python code, two variable "c and length" variables are declared, in variable c is used to input char variable value, in the next line, length variable is defined, that accepts total height from the user.

In the next line, two for loop is declared, it uses as nested looping, in which the outer loop prints column values and inner the loop is used to prints rows. To prints all the value the print method is used, which prints the user input character triangle.
Final answer:

The question asks how to modify a program to print a right triangle using a character and height defined by the user. The solution is to use a nested loop, wherein an outer loop specifies the number of rows equal to the triangle's height and the inner loop iterates over each row to print the specified character. The range of the inner loop increases with each outer loop iteration.

Explanation:

To modify the given program to output a right triangle using the user-specified character and of a specified height, we would implement a nested loop in the program. An outer loop would control the number of rows, which equals the triangle's height, and an inner loop would handle the printing of the user-specified character per line. The inner loop's range would increase with each iteration of the outer loop. Here's an example in Python:

triangle_char = input('Enter a character: ') triangle_height = int(input('Enter triangle height: ')) for i in range(1, triangle_height + 1):for j in range(i): print(triangle_char, end=' ') print()

The triangle_char variable is the character used to generate the triangle. The triangle_height variable determines the number of rows. The range() function in the loops determines how many times the loop executes.

Learn more about Programming Nested Loops here:

https://brainly.com/question/35123300

#SPJ11

2. Suppose a computer using direct mapped cache has 220 words of main memory and a cache of 32 blocks, where each cache block contains 16 words. a. How many blocks of main memory are there? b. What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, block, and word fields? c. To which cache block will the memory reference 0DB6316 map? d. In many computers the cache block size is in the range of 32 to 128 bytes. What would be the main advantages and disadvantages of making the size of the cache blocks larger or smaller within this range

Answers

Answer:

(a) The block size = 16 words (b) the format for the sizes of the tag, block, and word fields are stated below:

Tag Block Offset  

11 bits 5 bits 4 bits

(c)The memory address 0DB63 will map to 22nd block and 3 byte of a block. (d)  The main advantage of the cache is, when the cache block is made larger or bigger then, there are fewer misses. this occur when the data in the block is used.

One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful. here there is also a larger miss penalty.

Explanation:

Solution

(a)The Cache of 32 blocks and the memory is word addressable  

The main memory size is not stated, so let's consider it as 2^20  

The main memory size = 2^20  

The block size = 16 words  

The Number of blocks = main memory size/ block size = 2^20/16. = 2^16= 64 K words.

(b) The Main memory is 2^20, which says it is 1 M words size and it requires 20 bits  

Now,

From which 32 cache block requires 2^5, 5 bits and block size means offset requires 2^4, 4 bits

Thus, the sizes of the tag, block, and word fields are stated below:

Tag Block Offset  

11 bits 5 bits 4 bits

(c)The hexadecimal address is 0DB63 , its binary equivalent is  

0000 1101 1011 0110 0011  

The tag = ( first 11 bits) = 0000 1101 101  

block = ( next 5 bits ) = 1 0110  

offset = ( next 4 bits ) = 0011  

Therefore, the memory address 0DB63 will map to 22nd block and 3 byte of a block.

(d) The main advantage of the cache is that, when the cache block is made larger or bigger then, there are fewer misses. this occur when the data in the block is used.

One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful. here there is also a larger miss penalty.

In this exercise we want to use computer and C++ knowledge to write the code correctly, so it is necessary to add the following to the informed code:

(a) The block size = 16 words

(b) Tag Block Offset  

11 bits 5 bits 4 bits

(c)The memory address 0DB63 will map to 22nd block and 3 byte of a block.

(d)  The main advantage of the cache is, when the cache block is made larger or bigger then, there are fewer misses. One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful.

So analyzing the first question about the code we find that:

(a)The Cache of 32 blocks and the memory is word addressable :

The main memory size; [tex]2^{20[/tex] The block size; [tex]16 \ words[/tex]   The Number of blocks = main memory size/ block size: [tex]2^{20}/16 = 2^{16}= 64[/tex]

(b) Says it is 1 M words size and it requires 20 bits. Now, from which 32 cache block requires 2^5, 5 bits and block size means offset requires 2^4, 4 bits. Thus, the sizes of the tag, block, and word fields are stated below:

Tag Block Offset   11 bits 5 bits 4 bits

(c)The hexadecimal address is 0DB63 , its binary equivalent is  

 

The tag = ( first 11 bits) = 0000 1101 101   block = ( next 5 bits ) = 1 0110   offset = ( next 4 bits ) = 0011  

Therefore, the memory address 0DB63 will map to 22nd block and 3 byte of a block.

(d) The main favored position or circumstance of the cache happen that, when the cache block is created best or considerable therefore, there happen hardly any misses. this take place when the information in visible form in the block exist secondhand. One of the loss exist that if the data exist not secondhand before the cache block exist detached from the cache, then it exist not any more valuable. in this place there exist in addition to a best miss punishment.

See more about computer at brainly.com/question/950632

Suppose you are currently in the /home/hnewman/os/fall/2013 directory and would like to navigate to /home/hnewman/discreteStructures/spring/2011 directory and would like to navigate using absolute path names. What command will you type in the shell? A. cd /home/hnewman/discreteStructures/spring/2011 B. cd discreteStructures/spring/2009 C. cd ../../..discreteStructures/spring/2009 D. cd ../../discreteStructures/spring/2009

Answers

Answer:

  A. cd /home/hnewman/discreteStructures/spring/2011

Explanation:

Nothing with 2009 in the pathname will get you where you want to go. The only reasonable answer choice is the first one:

  cd /home/hnewman/discreteStructures/spring/2011

Bob is stationed as a spy in Cyberia for a week and wants to prove that he is alive every day of this week and has not been captured. He has chosen a secret random number, x, which he memorized and told to no one. But he did tell his boss the value y = H(H(H(H(H(H(H(x))))))), where H is a one-way cryptographic hash function. Unfortunately, he knows that the Cyberian Intelligence Agency (CIA) was able to listen in on that message; hence, they also know the value of y. Explain how he can send a single message every day that proves he is still alive and has not been captured. Your solution should not allow anyone to replay any previous message from Bob as a (false) proof he is still alive.

Answers

Bob can use a hash chain method with a cryptographic hash function to send a message daily, validating his aliveness without risk of replay attacks. Each day he reveals the previous hash in the chain, which can be verified by hashing to obtain the initially shared value.

In order for Bob to prove he is still alive and has not been captured, without the risk of replay attacks, a strategy called hash chain can be employed using the cryptographic hash function. Bob starts with his secret random number x and computes a hash of it, H(x). He then repeatedly applies the hash function to this result a number of times equal to the number of days he needs to send a message (in this case, 7 times since he is there for a week), resulting in y = H(H(H(H(H(H(H(x))))))).

Each day, Bob unveils the previous hash in the chain. For example, on the first day, he sends H(H(H(H(H(H(x)))))), which anyone can hash once to verify it leads to y, the value his boss already knows. On the second day, he sends H(H(H(H(H(x))))), and so on. This proves that each message can only have come from someone with knowledge of the previous day's secret -- presumably, Bob himself. Because hash functions are one-way, even if someone knows the value H(x), they cannot reverse-engineer to find x.

This method ensures that even if the Cyberian Intelligence Agency (CIA) intercepted a message, they could not fake a future message since they would not be able to produce the next hash in the sequence without knowing the current one.

Develop a crawler that collects the email addresses in the visited web pages. You can write a function emails() that takes a document (as a string) as input and returns the set of email addresses (i.e., strings) appearing in it. You should use a regular expression to find the email addresses in the document.

Answers

Answer:

see explaination

Explanation:

import re

def emails(document):

"""

function to find email in given doc using regex

:param document:

:return: set of emails

"""

# regex for matching emails

pattern = r'[\w\.-]+at[\w\.-]+\.\w+'

# finding all emails

emails_in_doc = re.findall(pattern, document)

# returning set of emails

return set(emails_in_doc)

# Testing the above function

print(emails('random text ertatxyz.com yu\npopatxyz.com random another'))

3.27 LAB: Exact change (FOR PYTHON PLEASE)
Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies.

Ex: If the input is:

0
(or less than 0), the output is:

No change
Ex: If the input is:

45
the output is:

1 Quarter
2 Dimes

Answers

Answer:

amount = int(input())

#Check if input is less than 1

if amount<=0:

    print("No change")

else: #If otherwise

    #Convert amount to various coins

    dollar = int(amount/100) #Convert to dollar

    amount = amount % 100 #Get remainder after conversion

    quarter = int(amount/25) #Convert to quarters

    amount = amount % 25 #Get remainder after conversion

    dime = int(amount/10) #Convert to dimes

    amount = amount % 10 #Get remainder after conversion

    nickel = int(amount/5) #Convert to nickel

    penny = amount % 5 #Get remainder after conversion

    #Print results

    if dollar >= 1:

          if dollar == 1:

                print(str(dollar)+" Dollar")

          else:

                print(str(dollar)+" Dollars")

    if quarter >= 1:

          if quarter == 1:

                print(str(quarter)+" Quarter")

          else:

                print(str(quarter)+" Quarters")

    if dime >= 1:

          if dime == 1:

                print(str(dime)+" Dime")

          else:

                print(str(dime)+" Dimes")

    if nickel >= 1:

          if nickel == 1:

                print(str(nickel)+" Nickel")

          else:

                print(str(nickel)+" Nickels")

    if penny >= 1:

          if penny == 1:

                print(str(penny)+" Penny")

          else:

                print(str(penny)+" Pennies")

Explanation:

The first answer is almost right, but this should give you the complete answer with the proper starting point and correct capitalizations.

The program is an illustration of conditional statements.

Conditional statements are statements whose execution depends on its truth value.

The program in Python, where comments are used to explain each line is as follows:

#This gets input for the amount

amount = int(input("Enter Amount:  "))

#This checks if the amount is less than 1

if amount<=0:  

    print("No Change")

else: #If otherwise

    #The next lines convert amount to various coins  

    dollar = int(amount/100) #Convert to dollar

    amount = amount % 100 #Get remainder after conversion

    quarter = int(amount/25) #Convert to quarters

    amount = amount % 25 #Get remainder after conversion

    dime = int(amount/10) #Convert to dimes

    amount = amount % 10 #Get remainder after conversion

    nickel = int(amount/5) #Convert to nickel

    penny = amount % 5 #Get remainder after conversion

    #The following if statements print the change

    #The prints dollars  

    if dollar >= 1:  

          if dollar == 1:

                print(str(dollar)+" dollar")

          else:

                print(str(dollar)+" dollars")

    #The prints quarters

    if quarter >= 1:

          if quarter == 1:

                print(str(quarter)+" quarter")

          else:

                print(str(quarter)+" quarters")

    #The prints dimes

    if dime >= 1:

          if dime == 1:

                print(str(dime)+" dime")

          else:  

                print(str(dime)+" dimes")

    #The prints nickels

    if nickel >= 1:

          if nickel == 1:

                print(str(nickel)+" nickel")

          else:

                print(str(nickel)+" nickels")

    #The prints pennies

    if penny >= 1:

          if penny == 1:

                print(str(penny)+" penny")

          else:

                print(str(penny)+" pennies")

Read more about similar programs at:

https://brainly.com/question/16839801

Write a function called find_max that takes in a single parameter called random_list, which should be a list. This function will find the maximum (max) value of the input list, and return it. This function will assume the list is composed of only positive numbers. To find the max, within the function, use a variable called list_max that you initialize to value 0. Then use a for loop to loop through random_list. Inside the list, use a conditional to check if the current value is larger than list_max, and if so, re-assign list_max to store this new value. After the loop, return list_max, which should now store the maximum value from within the input list.

Answers

Answer:

see explaination

Explanation:

python code

def find_max(random_list):

list_max=0

for num in random_list:

if num > list_max:

list_max=num

return list_max

print(find_max([1,45,12,11,23]))

Which type of styles can be applied to a word, phrase, or sentence?
Format
Object
Paragraph
Character
Resume

Answers

Answer:

I think the answer is going to be paragraph

The types of styles that can be applied to a word, phrase, or sentence are the character style and paragraph style. Thus, the correct options for this question are C and D.

What do you mean by Character style?

Character style may be defined as a type of style that can be used for the word, phrase, or sentence in design. This type of style considerably remembers formatting for single characters, words, or phrases.

While Paragraph Style will remember the formatting applied to a whole paragraph. This type of style is most frequently applied to a section of text separated from other text by line breaks with the intention to fragment the literary work into short paragraphs.

Therefore, the character and paragraph styles are the types of styles that can be applied to a word, phrase, or sentence.

To learn more about Paragraph styles, refer to the link:

https://brainly.com/question/13149944

#SPJ2

Which term describes measurable results expected in a given time frame?

Answers

Answer: I think a deadline?

The term that describes the results expected in a given time frame is the goal. The correct option is A.

What are goals?

The desired states that people want to achieve, maintain, or avoid are referred to as life goals. When we make goals, we commit to imagining, planning for, and obtaining these desired outcomes. The satisfaction with our careers is the satisfaction with our lives because we spend more than half of our waking hours at work.

The most significant professional goal we can set for ourselves is to identify our areas of love and make them into lifelong careers. An objective is something you hope to accomplish. It is the desired outcome that you or a group of people plan for and firmly resolve to attain. The phrase "goal" refers to the outcomes anticipated in a specific time range.

Therefore, the correct option is A, Goals.

To learn more about goals, refer to the link:

https://brainly.com/question/21032773

#SPJ2

The question is incomplete. Your most probably complete question is given below:

Goals

Mind maps

Purposes

Ideas

Write a Java class to perform the following: 1. Write a method to search the following array using a linear search, ( target elements: 11, 55, 17.). (count the number of comparisons needed). {06, 02, 04, 07, 11, 09, 50, 62, 43, 32, 13, 75, 01, 46, 88, 17} 2. Write a method to sort the array using Selection Sort. (count the number of comparisons needed) 3, Write a method to sort the array using Bubble Sort. (count the number of comparisons needed) 4, Search he sorted array using a binary search (recursive) for the same set of target elements. (count the number of comparisons needed)

Answers

Answer:

Check the explanation

Explanation:

Linear search in JAVA:-

import java.util.Scanner;

class linearsearch

{

  public static void main(String args[])

  {

     int count, number, item, arr[];

     

     Scanner console = new Scanner(System.in);

     System.out.println("Enter numbers:");

     number = console.nextInt();

   

     arr = new int[number];

     System.out.println("Enter " + number + " ");

     

     for (count = 0; count < number; count++)

       arr[count] = console.nextInt();

     System.out.println("Enter search value:");

     item = console.nextInt();

     for (count = 0; count < number; count++)

     {

        if (arr[count] == item)

        {

          System.out.println(item+" present at "+(count+1));

         

          break;

        }

     }

     if (count == number)

       System.out.println(item + " doesn't found in array.");

  }

}

Kindly check the first attached image below for the code output.

Selection Sort in JAVA:-

public class selectionsort {

   public static void selectionsort(int[] array){

       for (int i = 0; i < array.length - 1; i++)

       {

           int ind = i;

           for (int j = i + 1; j < array.length; j++){

               if (array[j] < array[ind]){

                   ind = j;

               }

           }

           int smaller_number = array[ind];  

           array[ind] = array[i];

           array[i] = smaller_number;

       }

   }

     

   public static void main(String a[]){

       int[] arr = {9,94,4,2,43,18,32,12};

       System.out.println("Before Selection Sort");

       for(int i:arr){

           System.out.print(i+" ");

       }

       System.out.println();

         

       selectionsort(arr);

       

       System.out.println("After Selection Sort");

       for(int i:arr){

           System.out.print(i+" ");

       }

   }

}  

Kindly check the second attached image below for the code output.

Bubble Sort in JAVA:-

public class bubblesort {

   static void bubblesort(int[] array) {

       int num = array.length;

       int temp = 0;

        for(int i=0; i < num; i++){

                for(int j=1; j < (num-i); j++){

                         if(array[j-1] > array[j]){

                           

                                temp = array[j-1];

                                array[j-1] = array[j];

                                array[j] = temp;

                        }

                         

                }

        }

   }

   public static void main(String[] args) {

               int arr1[] ={3333,60,25,32,55,620,85};

               

               System.out.println("Before Bubble Sort");

               for(int i=0; i < arr1.length; i++){

                       System.out.print(arr1[i] + " ");

               }

               System.out.println();

                 

               bubblesort(arr1);

               

               System.out.println("After Bubble Sort");

               for(int i=0; i < arr1.length; i++){

                       System.out.print(arr1[i] + " ");

               }

 

       }

}  

Kindly check the third attached image below for the code output.

Binary search in JAVA:-

public class binarysearch {

  public int binarySearch(int[] array, int x) {

     return binarySearch(array, x, 0, array.length - 1);

  }

  private int binarySearch(int[ ] arr, int x,

        int lw, int hg) {

     if (lw > hg) return -1;

     int middle = (lw + hg)/2;

     if (arr[middle] == x) return middle;

     else if (arr[middle] < x)

        return binarySearch(arr, x, middle+1, hg);

     else

        return binarySearch(arr, x, lw, middle-1);

  }

  public static void main(String[] args) {

     binarysearch obj = new binarysearch();

     int[] ar =

       { 22, 18,12,14,36,59,74,98,41,23,

        34,50,45,49,31,53,74,56,57,80,

        61,68,37,12,58,79,904,56,99};

     for (int i = 0; i < ar.length; i++)

        System.out.print(obj.binarySearch(ar,

           ar[i]) + " ");

     System.out.println();

     System.out.print(obj.binarySearch(ar,19) +" ");

     System.out.print(obj.binarySearch(ar,25)+" ");

     System.out.print(obj.binarySearch(ar,82)+" ");

     System.out.print(obj.binarySearch(ar,19)+" ");

     System.out.println();

  }

}

Kindly check the fourth attached image below for the code output

2. Use inheritance to create a hierarchy of Exception classes -- EndOfSentenceException, PunctuationException, and CommaException. EndOfSentenceException is the parent class to PunctuationException, which is the parent class to CommaException. Test your classes in a Driver class with a main method that asks the user to input a sentence. If the sentence ends in anything except a period (.), exclamation point (!), or question mark (?), the program should throw a PunctuationException. If the sentence specifically ends in a comma, the program should throw a CommaException. Use a catch block to catch all EndOfSentenceExceptions, causing the program to print a message and terminate. If a general PunctuationException is caught, the program should print "The sentence does not end correctly." If a CommaException is caught, the program should print "You can't end a sentence in a comma." If there are no exceptions, the program should print "The sentence ends correctly." and terminate.

Answers

Answer:

See explaination

Explanation:

EndOfSentenceException.java

//Create a class EndOfSentenceException that

//extends the Exception class.

class EndOfSentenceException extends Exception

{

//Construtor.

EndOfSentenceException(String str)

{

System.out.println(str);

}

}

CommaException.java

//Create a class CommaException that extends the class

//EndOfSentenceException.

class CommaException extends EndOfSentenceException

{

//Define the constructor of CommaException.

public CommaException(String str)

{

super(str);

}

}

PunctuationException.java

//Create a class PunctuationException that extends the class

//EndOfSentenceException.

class PunctuationException extends EndOfSentenceException

{

//Constructor.

public PunctuationException(String str)

{

super(str);

}

}

Driver.java

//Include the header file.

import java.util.Scanner;

//Define the class Driver to check the sentence.

public class Driver {

//Define the function to check the sentence exceptions.

public String checkSentence(String str)

throws EndOfSentenceException

{

//Check the sentence ends with full stop,

//exclamation mark

//and question mark.

if(!(str.endsWith(".")) && !(str.endsWith("!"))

&& !(str.endsWith("?")))

{

//Check the sentence is ending with comma.

if(str.endsWith(","))

{

//Throw the CommaException.

throw new CommaException("You can't "

+ "end a sentence in a comma.");

}

//Otherwise.

else

{

//Throw PunctuationException.

throw new PunctuationException("The sentence "

+ "does not end correctly.");

}

}

//If the above conditions fails then

//return this message to the main function.

return "The sentence ends correctly.";

}

//Define the main function.

public static void main(String[] args)

{

//Create an object of Scanner

Scanner object = new Scanner(System.in);

//Prompt the user to enter the sentence.

System.out.println("Enter the sentence:");

String sentence=object.nextLine();

//Begin the try block.

try {

//Call the Driver's check function.

System.out.println(new

Driver().checkSentence(sentence));

}

//The catch block to catch the exception.

catch (EndOfSentenceException e)

{}

}

}

A company has offices in Honolulu, Seattle, Ogden, and Dublin, Ireland. There are transmission links between Honolulu and Seattle, Seattle and Ogden, and Ogden and Dublin. Seattle needs to communicate at 1 Gbps with each other site. Seattle and Dublin only need to communicate with each other at 1 Mbps. Ogden and Dublin need to communicate at 2 Gbps, and Ogden and Seattle need to communicate with each other at 10 Mbps. How much traffic will each transmission link have to carry? Show your work.

Answers

Answer:

See explaination

Explanation:

Looking at telecommunications network, a link is a communication channel that connects two or more devices for the purpose of data transmission. The link is likely to be a dedicated physical link or a virtual circuit that uses one or more physical links or shares a physical link with other telecommunications links.

Please check attachment for further solution.

Write a class called (d) Teacher that has just a main method. The main method should construct a GradeBook for a class with two students, "Jack" and "Jill". Jack’s grades on the three tests for the class are 33, 55, and 77. Jill’s grades are 99, 66, and 33. After constructing the GradeBook object, main should use the instance methods of the GradeBook class to determine the name of the student with the highest average grades. Print the name of this student on the screen.

Answers

Answer:

The java program is given below.

import java.util.*;

class GradeBook  

{

//variables to hold all the given values

static int m11, m12, m13;

static int m21, m22, m23;

static String name1, name2;

//variables to hold the computed values

static double avg1, avg2;

//constructor initializing the variables with the given values

GradeBook()

{

name1 = "Jack";

m11 = 33;

m12 = 55;

m13 = 77;

name2 = "Jill";

m21 = 99;

m22 = 66;

m23 = 33;

}

//method to compute and display the student having highest average grade

static void computeAvg()

{

avg1=(m11+m12+m13)/3;

avg2=(m21+m22+m23)/3;

if(avg1>avg2)

System.out.println("Student with highest average is "+ name1);

else

System.out.println("Student with highest average is "+ name2);

}  

}

//contains only main() method

public class Teacher{  

public static void main(String[] args)

{

//object created

GradeBook ob = new GradeBook();

//object used to call the method

ob.computeAvg();

}

}

OUTPUT

Student with highest average is Jill

Explanation:

1. The class GradeBook declares all the required variables as static with appropriate data types, integer for grades and double for average grade.

2. Inside the constructor, the given values are assigned to the variables.

3. The method, computeAvg(), computes the average grade of both the students. The student having highest average grade is displayed using System.out.println() method.

4. Inside the class, Teacher, the main() method only has 2 lines of code.

5. The object of the class GradeBook is created.

6. The object is used to call the method, computeAvg(), which displays the message on the screen.

7. All the methods are also declared static except the constructor. The constructor cannot have any return type nor any access specifier.

8. The program does not takes any user input.

9. The program can be executed with different values of grades and names of the students.

Where can we buy a cryptocurrency? from below options

A) Through a private transaction

B) All the options

C) Cryptocurrency Exchanges

D) In a smart contract

Answers

it would be C

hope this helps!

The Phonebook class must also have the following functions: Constructor with 1 integer parameter for size (numberOfContacts is initially set to 0; allocate memory for myContacts). Copy constructor. Assignment operator. Destructor. int getNumberOfContacts() // Getter int getSize() // Getter contact getContact(int i) //returns contact at index i (you can assume 0 < i < numberOfContacts) bool addContact(string name, string phonenumber, string email) // add a new contact at the end of the phonebook using the received parameters. Returns true if succesful, false if the contact couldn't be added because the phonebook is already full.

Answers

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

struct contact

{

string name;

string phoneNumber;

string email;

bool available;

};

class Phonebook

{

private :

int numberOfContacts;

int size;

contact *myContacts;

public :

Phonebook(int size)

{

this->size=size;

this->numberOfContacts=0;

myContacts=new contact[size];

}

~Phonebook()

{

delete[] myContacts;

}

int getNumberOfContacts()

{

return numberOfContacts;

}

int getSize()

{

return size;

}

void addContact(string name,string phonenumber,string email)

{

contact c;

c.name=name;

c.phoneNumber=phonenumber;

c.email=email;

c.available=true;

myContacts[numberOfContacts]=c;

numberOfContacts++;

}

void removeContact(string name)

{

for(int i=0;i<numberOfContacts;i++)

{

if(myContacts[i].name.compare(name)==0)

{

this->myContacts[i].available=false;

contact temp=myContacts[numberOfContacts-1];

myContacts[numberOfContacts-1]=myContacts[i];

myContacts[i]=temp;

numberOfContacts--;

}

}

}

Phonebook(const Phonebook& pb)

{

this->myContacts=pb.myContacts;

this->size=pb.size;

this->numberOfContacts=numberOfContacts;

}

Phonebook& operator=(const Phonebook & pb)

{

myContacts=new contact[size];

this->size=pb.size;

this->numberOfContacts=pb.numberOfContacts;

for(int i=0;i<numberOfContacts;i++)

{

this->myContacts[i]=pb.myContacts[i];

}

return *this;

}

void print()

{

for(int i=0;i<numberOfContacts;i++)

{

if(myContacts[i].available==true)

{

cout<<"Name :"<<myContacts[i].name<<endl;

cout<<"Phone Number :"<<myContacts[i].phoneNumber<<endl;

cout<<"Email :"<<myContacts[i].email<<endl;

cout<<endl;

}

}

}

};

int main(){

Phonebook pb1(10);

pb1.addContact("Williams","9845566778","williamatmail.com");

pb1.addContact("James","9856655445","jamesatmail.com");

cout<<"_____ Displaying Phonebook#1 contacts _____"<<endl;

pb1.print();

pb1.removeContact("Williams");

cout<<"_____ After removing a contact Displaying Phonebook#1 _____"<<endl;

pb1.print();

Phonebook pb2(5);

pb2.addContact("Billy","9845554444","billyatmail.com");

pb2.addContact("Jimmy","9834444444","jimmyatmail.com");

cout<<"_____ Displaying Phonebook#2 contacts _____"<<endl;

pb2.print();

pb2=pb1;

cout<<"____ After Assignment Operator Displaying Phonebook#2 contacts____"<<endl;

pb2.print();

return 0;

}

Nb: Replace the at with at symbol.

Consider the problem of solving two 8-puzzles.





a. Give a complete problem formulation.




b. How large is the reachable state space? Give an exact numerical expression.




c. Suppose we make the problem adversarial as follows: the two players take turns moving; a coin is flipped to determine the puzzle on which to make a move in that turn; and the winner is the first to solve one puzzle. Which algorithm can be used to choose a move in this setting?




d. Give an informal proof that someone will eventually win if both play perfectly.

Answers

Answer:

See Explaination

See Explaination

Explanation:

d. If both players play perfectly, then too each player will play not let the other win. Let there be a state of the game in which the goal state can be achieved in just 2 more moves. If player 1 makes one move then the next move made player 1 will win or player 2 do the same.

Either way whatever the rule states, there must be a winner emerging.

Check attachment for option a to c.

Final answer:

The problem of solving two 8-puzzles involves having a specific goal state, making moves on a puzzle, and using an algorithm like Minimax for an adversarial setting. The reachable state space size of an 8-puzzle is 181,440. Given perfect play, an eventual win is guaranteed due to the finite number of puzzle configurations.

Explanation:

a. The problem of solving an 8-puzzle can be formulated as follows: The goal state is a specific configuration of tiles, with an empty space in a particular location. The actions are to move the empty space up, down, left, or right, swapping it with the adjacent tile. The transition model returns the new configuration of tiles resulting from the action. A cost function could return 1 for each move.

b. The size of reachable state space for an 8-puzzle is 9!/2 = 181,440.

c. In the adversarial setting described, a Minimax algorithm could be used to determine the best move.

d. An eventual win in this setting can be informally proven by noting that with each move, the current state of the puzzle moves closer to the goal state. Since there is a limited number of configurations (as determined in part b), the puzzle cannot be played indefinitely and eventually one player will reach the goal state.

Learn more about 8-Puzzle Solving here:

https://brainly.com/question/33562838

#SPJ3

Implement a Breadth-First Search of the people in the network who are reachable from person id 3980. You can implement BFS with a queue and the pseudocode is given in CLRS. Print out the distance (number of connections) from person 3980 to every person who is reachable from 3980 via edge traversals. Note that not all people in this network may be reachable via edge traversals from user id 3980, so users that are not accessible can be ignored in BFS.

Answers

Answer:

Check the explanation

Explanation:

import java.io.File;

import java.io.FileNotFoundException;

import java.util.LinkedList;

import java.util.Scanner;

import static org.junit.Assert.assertEquals;

/**

* CS146 Assignment 3 Node class This class is used for undirected graphs

* represented as adjacency lists The areFriends() method checks if two people

* are friends by checking if an edge exists between the two

*

*/

public class NetworkAdjList {

   // Initialize array with max number of vertices taken from SNAP

   static int max_num_vertices = 88234;

   static LinkedList<Integer>[] adjacencyList = new LinkedList[max_num_vertices];

   public static void createAdjacencyList() {

       // Initialize array elements

       for (int j = 0; j < max_num_vertices; j++) {

           adjacencyList[j] = new LinkedList<Integer>();

       }

       // Get file path of the 3980.edges file

       String filePath = "C:\\Users\\shahd\\Documents\\CS146\\Assignment 3\\Question 3\\Question3\\src\\a3\\3980.edges";

       File f = new File(filePath);

       // Use Scanner to read edges from the file and put it into adjacency list

       int a;

       int b;

       try {

           Scanner fileIn = new Scanner(f);

           while (fileIn.hasNext()) {

               a = fileIn.nextInt();

               b = fileIn.nextInt();

               adjacencyList[a].add(b);

               adjacencyList[b].add(a); // We need to add the edges both ways

           }

       } catch (FileNotFoundException e) {

           e.printStackTrace();

       }

   }

   public static boolean areFriends(int A, int B) {

       // If the adjacency list contains (A, B) edge, then return true, else false

       if (adjacencyList[A].contains(B)) {

           return true;

       } else {

           return false;

       }

   }

  private static void bfsHelper(boolean visited[], int currentNode, int dis, int sourceNode) {

       dis++;

       if(!visited[currentNode]) {

           visited[currentNode] = true;

           

           for(int neighbor: adjacencyList[currentNode]) {

               System.out.println(neighbor + " is at a distance of " + dis + " from " + sourceNode);

               bfsHelper(visited, neighbor, dis++, sourceNode);

           }

       }

   }

   public static void BFStraversal(int start) {

       boolean visited[] = new boolean[max_num_vertices];

       bfsHelper(visited, start, 0, start);

   }

   public static void main(String[] args) {

       /**

        * These test cases assume the file 3980.edges was used

        */

       createAdjacencyList();

       System.out.println("Testing...");

       assertEquals(areFriends(4038, 4014), true);

       System.out.println("1 of 7");

       System.out.println("Testing...");

       assertEquals(areFriends(3982, 4037), true);

       System.out.println("2 of 7");

       System.out.println("Testing...");

       assertEquals(areFriends(4030, 4017), true);

       System.out.println("3 of 7");

       System.out.println("Testing...");

       assertEquals(areFriends(4030, 1), false);

       System.out.println("4 of 7");

       System.out.println("Testing...");

       assertEquals(areFriends(1, 4030), false);

       System.out.println("5 of 7");

       System.out.println("Testing...");

       assertEquals(areFriends(4003, 3980), true);

       System.out.println("6 of 7");

       System.out.println("Testing...");

       assertEquals(areFriends(3985, 4038), false);

       System.out.println("7 of 7");

       System.out.println("Success!");

   }

}

**************************************************

Given a base Plant class and a derived Flower class, complete main() to create an ArrayList called myGarden. The ArrayList should be able to store objects that belong to the Plant class or the Flower class. Create a method called printArrayList(), that uses the printInfo() methods defined in the respective classes and prints each element in myGarden. The program should read plants or flowers from input (ending with -1), adding each Plant or Flower to the myGarden ArrayList, and output each element in myGarden using the printInfo() method.

Answers

Final answer:

The question involves creating an ArrayList that stores objects of type Plant and Flower, reading these objects from input, and printing their information using a defined method in Java.

Explanation:

The student's question pertains to object-oriented programming in Java and involves working with classes, inheritance, and polymorphism within an ArrayList. To solve this, you'll need to create an ArrayList that can store objects of both the Plant and Flower classes. The Plant class is the base class, while the Flower class is the derived class. You will then implement a printArrayList() method to iterate through the myGarden ArrayList and call the printInfo() method on each object.

Since both Plant and Flower objects can be added to myGarden, the printInfo() method needs to be defined in both the Plant and Flower classes, possibly overriding the method in Flower if it requires different behavior. The process of reading input and adding plants or flowers would continue until encountering a '-1', which signifies the end of input. After populating the ArrayList, the printArrayList() method will be called to display the information about each plant or flower in the garden.

Final answer:

The question involves creating an ArrayList in Java to hold Plant and Flower objects, utilizing polymorphism to store and process them. A printArrayList() method is employed to iterate through the ArrayList and call the printInfo() method on each Plant and Flower object.

Explanation:

The question revolves around object-oriented programming in Java, specifically dealing with the concept of polymorphism and ArrayLists. To accomplish the task, you will need to create an ArrayList that can hold objects of the Plant class as well as objects of the derived Flower class. This is possible because of polymorphism, where a Flower 'is-a' Plant, and thus can be treated as one.

To provide you with a starting point, here's an example of a possible printArrayList() method:

void printArrayList(ArrayList myGarden) {
  for (Plant p : myGarden) {
     p.printInfo();
  }
}

The actual main() is not provided here but would involve initializing the ArrayList, looping to read inputs, creating Plant or Flower objects based on the input, adding them to the myGarden ArrayList, and then calling the printArrayList() method to display the information for each plant or flower in the garden. Notice that the printInfo() method is called for each element; this method is expected to be defined in both the Plant and Flower classes, leveraging polymorphism for dynamic method dispatch.

what is the molarity of a solution prepared by dissolving 15.0g of sodium hydroxide in enough water to make a total of 225 ml of solution​

Answers

Answer:

1.6666 g/mol = 1 [tex]\frac{2}{3}[/tex] g/mol

Explanation:

Molar mass of NaOH= 23+16+1 =40g/mol

Mols in 15g = 15/40 mol

If this was dissolved in 225ml of water molarity of the solution is

[tex]\frac{15}{40}[/tex] ÷ 225 x 1000 = 1.6666 g/mol = 1 [tex]\frac{2}{3}[/tex] g/mol

Final answer:

The molarity of the sodium hydroxide solution is calculated by dividing the number of moles of NaOH (0.375 moles) by the volume of the solution in liters (0.225 L), resulting in 1.667 M.

Explanation:

The molarity of a solution is determined by the number of moles of solute per liter of solution. To find the molarity of the solution, we need to know the molar mass of sodium hydroxide (NaOH), which is approximately 40 g/mol. First, we convert the mass of NaOH to moles:

Mass of NaOH = 15.0 g

Molar mass of NaOH = 40 g/mol

Moles of NaOH = Mass / Molar mass = 15.0 g / 40 g/mol = 0.375 moles

Second, we convert the volume of the solution from milliliters to liters:

Volume of solution = 225 mL

1 liter = 1000 mL

Volume in liters = 225 mL / 1000 = 0.225 liters

Finally, we calculate the molarity of the solution using the formula:

Molarity (M) = Moles of solute / Volume of solution in liters

Molarity (M) = 0.375 moles / 0.225 liters

Molarity (M) = 1.667 M

Therefore, the molarity of the sodium hydroxide solution is 1.667 M.

Create a Visual Logic flow chart with four methods. Main method will create an array of 5 elements, then it will call a read method, a sort method and a print method passing the array to each. The read method will prompt the user to enter 5 numbers that will be stored in the array. The sort method will sort the array in ascending order (smallest to largest). The print method will print out the array.

Answers

Answer:

See explaination

Explanation:

import java.util.Scanner;

public class SortArray {

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner sc = new Scanner(System.in);

System.out.println("Enter Size Of Array");

int size = sc.nextInt();

int[] arr = new int[size]; // creating array of size

read(arr); // calling read method

sort(arr); // calling sort method

print(arr); // calling print method

}

// method for read array

private static void read(int[] arr) {

Scanner sc = new Scanner(System.in);

for (int i = 0; i < arr.length; i++) {

System.out.println("Enter " + i + "th Position Element");

// read one by one element from console and store in array

arr[i] = sc.nextInt();

}

}

// method for sort array

private static void sort(int[] arr) {

for (int i = 0; i < arr.length; i++) {

for (int j = 0; j < arr.length; j++) {

if (arr[i] < arr[j]) {

// Comparing one element with other if first element is greater than second then

// swap then each other place

int temp = arr[j];

arr[j] = arr[i];

arr[i] = temp;

}

}

}

}

// method for display array

private static void print(int[] arr) {

System.out.print("Your Array are: ");

// display element one by one

for (int i = 0; i < arr.length; i++) {

System.out.print(arr[i] + ",");

}

}

}

See attachment

A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front door. A pressure sensor under the mat changes from OFF (0) to ON (1) when someone stands on the doormat. The light sensor is ON (1) when it is light and OFF (0) when it is dark. Design a program to show what would happen to the lamp. Account for all possible scenarios by determining whether the pressure sensor and light sensor are ON or OFF. (HINT: Ask the user "Is it dark?" and "Is someone standing on the doormat outside the front door?")

Answers

Answer:

See explaination

Explanation:

#include <iostream>

#include <string>

using namespace std;

int main()

{

string raptor_prompt_variable_zzyz;

?? standing;

?? dark;

raptor_prompt_variable_zzyz ="Is it dark?";

cout << raptor_prompt_variable_zzyz << endl;

cin >> DARK;

if (DARK=="Yes")

{

raptor_prompt_variable_zzyz ="Is someone standing on the doormat outside the front door?";

cout << raptor_prompt_variable_zzyz << endl;

cin >> STANDING;

if (STANDING=="Yes")

{

cout << "LAMP IS ON" << endl; }

else

{

cout << "LAMP IS OFF" << endl; }

}

else

{

cout << "LAMP IS OFF" << endl; }

return 0;

}

Here's a simple program in pseudo-code to demonstrate the behavior of the lamp based on the inputs from the light sensor and pressure sensor:

Ask user: "Is it dark?" (yes or no)

Read user's response and store it in variable 'is_dark'

Ask user: "Is someone standing on the doormat outside the front door?" (yes or no)

Read user's response and store it in variable 'is_someone_on_doormat'

if is_dark equals yes and is_someone_on_doormat equals yes:

   Turn on the lamp

   Display message: "Lamp turned on because it is dark and someone is standing on the doormat."

else if is_dark equals yes and is_someone_on_doormat equals no:

   Keep the lamp off

   Display message: "Lamp remains off because it is dark but no one is standing on the doormat."

else if is_dark equals no and is_someone_on_doormat equals yes:

   Turn on the lamp

   Display message: "Lamp turned on because someone is standing on the doormat."

else:

   Keep the lamp off

   Display message: "Lamp remains off because it is not dark and no one is standing on the doormat."

This program covers all possible scenarios based on the inputs from the light sensor and pressure sensor and determines whether the lamp should be turned on or off accordingly.

Complexities of communication are organized into successive layers of protocols: lower-level layers are more specific to medium, higher-level layers are more specific to application. Match the layer name to its functionality: Transport layer Network layer Data link layer Physical layer A. controls transmission of the raw bit stream over the medium B. establishes, maintains and terminates network connections C. ensures the reliability of link D. provides functions to guarantee reliable network link

Answers

Answer:

Transport layer

establishes, maintains and terminates network connections

Network layer

ensures the reliability of link

Data link layer

provides functions to guarantee reliable network link

Physical layer

controls transmission of the raw bit stream over the medium

Explanation:

see Answer

Write a function remove_italicized_text that takes one parameter, a string named sentence. The string might contain HTML tags for representing italicized text. An HTML tag is a kind of code that directs the web browser to format content in a particular way.

Answers

Answer:

See explaination

Explanation:

def remove_italicized_text(x):

ans = ""

n = len(x) # length of string

i = 0

while i < n:

if x[i:(i+3)] == "<i>": # check for opening italic html tag

i += 3

cur = ""

while i < n:

if x[i:(i+4)] == "</i>": # check for closing italic html tag

break

cur += x[i]

i += 1

i += 4

ans += cur # add the text between two tags into output string

ans += " " # adding a space between two next

ans += cur # add the text again

else:

ans += x[i]

i += 1

return ans

sentence = "<i>Stony Brook</i>"

print("sentence = " + sentence)

print("Return value: " + remove_italicized_text(sentence))

print("\n")

sentence = "I <i>love</i> SBU, yes I do!"

print("sentence = " + sentence)

print("Return value: " + remove_italicized_text(sentence))

print("\n")

sentence = "Hey <i>Wolfie</i>, he's so fine, we hug him <i>all the time</i>!"

print("sentence = " + sentence)

print("Return value: " + remove_italicized_text(sentence))

print("\n")

sentence = "This text has no italics tags."

print("sentence = " + sentence)

print("Return value: " + remove_italicized_text(sentence))

print("\n")

Data related to the inventories of Costco Medical Supply are presented below: Surgical Equipment Surgical Supplies Rehab Equipment Rehab Supplies Selling price $ 272 $ 130 $ 350 $ 164 Cost 167 129 257 161 Costs to sell 28 18 19 10 In applying the lower of cost or net realizable value rule, the inventory of surgical supplies would be valued at:

Answers

Answer:

The following are the table attachment to this question.

Explanation:

In the given question a table is defined, in the column section, we assign "Particulars, Surgical Equipment, Surgical Supplies Rehab Equipment, Rehab Supplies, and total " and in the row section we assign values.

In the next step, to calculate the net realizable value, we subtract selling price from the cost to cell, and compare the value from the costs. If the value is smaller than then the net realizable value we write its value and at last total column we add all the net realizable value, which is equal to 690. In this table, the value of rehab supplies is $154.

Create an application that creates a report from quarterly sales. Console The Sales Report application Region Q1 Q2 Q3 Q4 1 $1,540.00 $2,010.00 $2,450.00 $1,845.00 2 $1,130.00 $1,168.00 $1,847.00 $1,491.00 3 $1,580.00 $2,305.00 $2,710.00 $1,284.00 4 $1,105.00 $4,102.00 $2,391.00 $1,576.00 Sales by region: Region 1: $7,845.00 Region 2: $5,636.00 Region 3: $7,879.00 Region 4: $9,174.00 Sales by quarter: Q1: $5,355.00 Q2: $9,585.00 Q3: $9,398.00 Q4: $6,196.00 Total sales: $30,534.00

Answers

Answer:

See explaination

Explanation:

package miscellaneous;

import java.text.NumberFormat;

import java.util.Currency;

import java.util.Locale;

public class sales {

public static void main(String[] args) {

double[][] sales= {

{1540.0,2010.0,2450.0,1845.0},//region1

{1130.0,1168.0,1847.0,1491.0},//region2

{1580.0,2305.0,2710.0,1284.0},//region3

{1105.0,4102.0,2391.0,1576.0}};//region4

//object for NumberFormat class

//needed in $

NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(java.util.Locale.US);

System.out.println("The sales report application: ");

//the j(th) element in i(th) row in sales matrix contains sales value for

//sales in j(th) quarter

System.out.println("Sales by quarter: ");

System.out.println("Region\tQ1\t\tQ2\t\tQ3\t\tQ4");

for(int i=0;i<sales.length;i++) {

System.out.print(i+1+"\t");

for(int j=0;j<sales[i].length;j++) {

System.out.print(defaultFormat.format(sales[i][j])+"\t");

}

System.out.println();

}

//i(th) row in the matrix has sales for i(th) region

System.out.println("Sales by region: \n");

for(int i=0;i<sales.length;i++) {

System.out.print("Region "+(i+1)+":");

double region_sale=0;

for(int j=0;j<sales[i].length;j++) {

region_sale+=sales[i][j];

}

System.out.println(defaultFormat.format(region_sale));

}

System.out.println("\nSales by Quarter: \n");

//we have quarters so for adding up their sales we need 4 variables

double q1=0;

double q2=0;

double q3=0;

double q4=0;

for(int i=0;i<sales.length;i++) {

for(int j=0;j<sales[i].length;j++) {

//j=0 implies the sales data for first quarter

if(j==0) {

q1+=sales[i][j];

}

//j=1 implies the sales data for second quarter

if(j==1) {

q2+=sales[i][j];

}

//j=2 implies the sales data for third quarter

if(j==2) {

q3+=sales[i][j];

}

//j=3 implies the sales data for fourth quarter

if(j==3) {

q4+=sales[i][j];

}

}

}

System.out.println("Q1: "+defaultFormat.format(q1));

System.out.println("Q2: "+defaultFormat.format(q2));

System.out.println("Q3: "+defaultFormat.format(q3));

System.out.println("Q4: "+defaultFormat.format(q4));

//with the help of 2 loops every sales data

//in the matrix can be accessed, which can be added

//to total_sales variable

double total_sales=0;

for(int i=0;i<sales.length;i++) {

for(int j=0;j<sales[i].length;j++) {

total_sales+=sales[i][j];

}

}

System.out.println("\nTotal Sales: "+defaultFormat.format(total_sales));

}

}

Write a Java program that prompts the user to enter a sequence of non-negative numbers (0 or more), storing them in an ArrayList, and continues prompting the user for numbers until they enter a negative value. When they have finished entering non-negative numbers, your program should return the mode (most commonly entered) of the values entered.

Answers

Answer: provided in explanation segment

Explanation:

the code to carry out this program is thus;

import java.util.ArrayList;

import java.util.Scanner;

public class ArrayListMode {

 

public static int getMode(ArrayList<Integer>arr) {

      int maxValue = 0, maxCount = 0;

      for (int i = 0; i < arr.size(); ++i) {

          int count = 0;

          for (int j = 0; j < arr.size(); ++j) {

              if (arr.get(j) == arr.get(i))

                  ++count;

          }

          if (count > maxCount) {

              maxCount = count;

              maxValue = arr.get(i);

          }

      }

      return maxValue;

  }

public static void main(String args[]){

  Scanner sc = new Scanner(System.in);

  ArrayList<Integer>list= new ArrayList<Integer>();

  int n;

  System.out.println("Enter sequence of numbers (negative number to quit): ");

  while(true) {

      n=sc.nextInt();

      if(n<=0)

          break;

      list.add(n);

  }

  System.out.println("Mode : "+getMode(list));

}

}

⇒ the code would produce Mode:6

cheers i hope this helps!!!!

What is the name of the top-level parentless folder in a digital file system?

Answers

Answer:

ROOT

Explanation:

Correct me if I'm wrong but I'm pretty sure it's called a "Root Folder" meaning it is the very first folder in the list

Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and 100), and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType. Your program must contain at least the following functions: A function to read the students’ data into the array. A function to assign the relevant grade to each student. A function to find the highest test score. A function to print the names of the students having the highest test score. Your program must output each student’s name in this form: last name followed by a comma, followed by a space, followed by the first name; the name must be left justified. Moreover, other than declaring the variables and opening the input and output files, the function main should only be a collection of function calls.

Answers

The program will manage students' test scores using a struct that records each student's name, score, and grade. It involves functions to input data, calculate grades, and identify the highest scorer. Output is formatted as 'LastName, FirstName: Grade'.

Explanation:

Program Structure for Student Grade Records

To create a program for managing student test scores and grades, we would define a struct named studentType with components studentFName, studentLName, testScore, and grade. We'd use an array of studentType of size 20 to store each student's details. The program would include functions to read student data, assign grades, find the highest test score, and print students with the highest score. Grades would be assigned based on the test scores in a typical A-F scale.

The main function should be clean and comprise primarily of function calls to handle various operations such as reading data and processing grades.

The output format for each student's name and grade should be "LastName, FirstName: Grade" with the last name and first name left justified, following the requirements specified for the assignment.

Other Questions
Mr.Prieto wants to buy pizza that costs $14 each and 5 sodas for $2 each. He has $94. Write and solve an equation to find out how many pizzas he can buy. What is the side length of a square with a perimeter of 80 meters?The side length ismeters. Consider the following situations. a. Bank reserves are $100, the public holds $200 in currency, and the desired reserve-deposit ratio is 0.25. Find deposits and the money supply. Instructions: Enter your responses as whole numbers. Deposits: $ Money supply: $ b. The money supply is $500 and currency held by the public equals bank reserves. The desired reserve-deposit ratio is 0.25. Find currency held by the public and bank reserves. Instructions: Enter your responses as whole numbers. Currency held by the public: $ Bank reserves: $ c. The money supply is $1,250, of which $250 is currency held by the public. Bank reserves are $100. Find the desired reserve-deposit ratio. 2. When and where was the game of Pickleball created? What was the purpose behind the Albany Movement? A. It was an attempt to desegregate the city. B. It was a demonstration held by the Ku Klux Klan. C. It was the city's attempt to integrate public schools. D. It was a protest against poll taxes and literacy tests. PLEASE HELP!!!!!!! (Will Mark Brainliest!)What are the domestic issues that the United States primarily focuses on? Also, which domestic issue do you think is most important? You must justify your answer in 3-4 sentences. Alexi is writing a research paper about the benefits of school uniforms. Which sentence best supports the argument that school uniforms increase school pride? Students who wear school uniforms spend less money on clothing. Students who dislike school uniforms at first usually get used to them after six months of wearing them. School uniforms help students get ready faster in the morning because they do not have to choose an outfit. Schools that have a uniform policy report lower rates of fighting and higher participation in after-school activities. Consider the equation %M + %V %P + %Y. If the velocity of money does not change (%V = 0), and the change in real GDP exactly keeps pace with the change in the money supply (%M = %Y), what will happen to the price level (P)? What is the value of x?(Sr Students are provided with a choice of two solutions. Each one is used to test the presence of a different chemical. How could students use one of these solutions to gather evidence for the action of photosynthesis? I WILL GIVE BRAINLIESTSolve the equation:5x + 65 = 25What is the value of x Massage therapists working in a clinic or medical office should address which of the following topics with the physician?how they can augment the physicians medical treatmenthow HIPAA does not apply to themthat the physician and massage therapist are of equal rankthat they are unfamiliar with medical terminology A(n) _____ identifies how you feel about an activity or subject. computer calculator interest inventory both b and c What is an Examples of carnivores If a vertical plane sliced a sphere, what would be the 2-D cross section?squarerectanglecircletriangle What is the direction of plate motion at a transform plate boundary? What were the two opposing sides in China's civil war? * In a standard 52card deck, half of the cards are red and half are black. The 52 cards are divided evenly into 4 suits: spades, hearts, diamonds, and clubs. Each suit has three face cards (jack, queen, king), and an ace. Each suit also has 9 cards numbered from 2 to 10.Dawn draws 1 card, replaces it, and draws another card. Is it more likely that she draws 2 black cards or 2 face cards?It is more likely that she draws 2 cards. A piece of corroded steel plate was found in a submerged ocean vessel. It was estimated that the original area of the plate was 17 in.2 and that approximately 2.1 kg had corroded away during the submersion. Assuming a corrosion penetration rate of 200 mpy for this alloy in seawater, estimate the time of submersion in years. The density of steel is 7.9 g/cm3. que significa impresionar a asustar b emocionar c sobresaltar d aterrorizar Steam Workshop Downloader