7. While an adjacency matrix is typically easier to code than an adjacency list, it is not always a better solution. Explain when an adjacency list is a clear winner in the efficiency of your algorithm

Answers

Answer 1

Answer:

The answer is below

Explanation:

Adjacency list is a technique in a computer science that is used for representing graph. It deals with a gathering of unorganized lists utilized to illustrate a limited graph. In this method, each list depicts the group of data of a peak in the graph

Adjacency List are most preferred to Adjacency Matrix in some cases which are:

1.  When the graph to is required to be sparsely.

2.  For iterability, Adjacent List is more preferable


Related Questions

Write an application named [LastName]_MultiplicationTable and create a method that prompts the user for an integer value, for example 7. Then display the product of every integer from 1 through 10 when multiplied by the entered value. For example, the first three lines of the table might read 1 x 7 = 7, 2 x 7 = 14, 3 x 7 = 21. .. . ..

Answers

Answer:

I did this in C# & Java

Explanation:

C#:

       public static void Main(string[] args)

       {

           int input = Convert.ToInt32(Console.ReadLine());

           Multiply(input);

       }

       public static int Multiply(int input)

       {

           int ans = 0;

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

           {

               ans = i*input;

               Console.WriteLine(i + "*" + input + "=" + ans);

           }

           return ans;

       }

Java:

   public static void main(String[] args)

   {

       Scanner myObj = new Scanner(System.in);  

       int input = Integer.parseInt(myObj.nextLine());

       Multiply(input);

   }

   public static int Multiply(int input)

   {

       int ans = 0;

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

           {

               ans = i*input;

               System.out.println(i + "*" + input + "=" + ans);

           }

       return ans;

   }

help me plzz thank you if your right I will mark brainiest

Answers

Answer:

the 1,2, and 3 are the second circle thingy and the fourth question is the first circle thing and dont know the last one hope this helps

Explanation:

Answer in this order.
B, B, B, B, A. I’m 80% sure these are the right answers.

write a program that calculates the total grade for N classroom exerices as a perfentage. the user should input the value for N followed by each of the N scores and totals.

Answers

Answer:

earned = 0

total = 0

exercises = int(input("Enter the number of exercises: "))

for i in range(exercises):

   score = int(input("Enter score" + str(i+1) + ": "))

   total_score = int(input("Enter total score for exercise " + str(i+1) + ": "))

   

   earned += score

   total += total_score

print("The total is %" + str(earned/total * 100))

Explanation:

*The code is in Python.

Set the earned and total as 0

Ask the user to enter the number of exercises

Create a for loop that iterates number of exercises times. For each exercise;

Ask the user to enter the score earned and total score of that exercise

Add the score to the earned (cumulative sum)

Add the total_score to the total (cumulative sum)

When the loop is done, calculate the percentage, divide earned by the total and multiply the result by 100, and print it

How does asymmetric encryption work?
A.
It uses only one key to encrypt and decrypt a message.
B.
A private key is used to encrypt the message and the public key is used to decrypt the message.
C.
Either the public key or the private key can be used to encrypt and decrypt a message.
D.
Public key is used to encrypt the message and private key is used to decrypt the message.

Answers

Answer:

i choose choice D

Explanation:

reason as to my answer public keys are simply input keys used to encrypt data into either a computer or any electrical device as private keys are out put used to either erase or edit

What is an example of a condition controlled loop? What would the syntax look like?

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

WHILE loops and DO WHILE loops are called the condition controlled loops. The execution of these loops depends on a certain condition, when the condition is true, the loop body will be executed and when the condition becomes false, the loop body will not be executed. the major difference between both loops is given below.

In the WHILE loop,  the condition is checked at the beginning of the loop whereas in the do-while loop condition is checked at the end of the loop and, in the do-while loop, the loop body is executed at least once.

The syntax of the while loop is given below

while (condition) {

 // code block to be executed

}

The syntax of do-while loop is given below

do {

 // code block to be executed

}

while (condition);

Seamus has too much text in one cell but wants all the information to be visible at once. What should he do? force the text to wrap force the text to spill-over truncate the text force the text to be inserted to next cell

Answers

Answer:

A: force the text to wrap

Explanation:

Just took the test and got it right!!! Hope this helps :D

Answer:

A) Force the text to wrap

Explanation:

Did it on ed2020

Using the Multiple-Alternative IFTHENELSE Control structure write the pseudocode to solve the following problem to prepare a contract labor report for heavy equipment operators: The input will contain the employee name, job performed, hours worked per day, and a code. Journeyman employees have a code of J, apprentices a code of A, and casual labor a code of C. The output consists of the employee name, job performed, hours worked, and calculated pay. Journeyman employees receive $20.00 per hour. Apprentices receive $15.00 per hour. Casual Labor receives $10.00 per hour.

Answers

Answer:

1. Start

2. Input Name, Jobs, Hours, Code

3. If Code == 'J' then

3.1 Pay = 20.00 * Hours

4. Else if Code == 'C' then

4.1 Pay = 15.00 * Hours

5. Else if Code == 'A' then

5.1 Pay = 10.00 * Hours

6. Output Name, Job, Hours, Pay

Explanation

This line starts the Pseudocode

1. Start

This line gets user inputs

2. Input Name, Jobs, Hours, Code

The following if and else statement determine the pay

3. If Code == 'J' then

3.1 Pay = 20.00 * Hours

4. Else if Code == 'C' then

4.1 Pay = 15.00 * Hours

5. Else if Code == 'A' then

5.1 Pay = 10.00 * Hours

This line prints the required output

6. Output Name, Job, Hours, Pay

We define the following terms:
Lexicographical Order, also known as alphabetic or dictionary order, orders characters as follows:
For example, ball < cat, dog < dorm, Happy < happy, Zoo < ball.
A substring of a string is a contiguous block of characters in the string. For example, the substrings of abc are a, b, c, ab, bc, and abc.
Given a string, , and an integer, , complete the function so that it finds the lexicographically smallest and largest substrings of length .
Input Format
The first line contains a string denoting .
The second line contains an integer denoting .
Constraints
consists of English alphabetic letters only (i.e., [a-zA-Z]).
Output Format
Return the respective lexicographically smallest and largest substrings as a single newline-separated string.
Sample Input 0
welcometojava
3
Sample Output 0
ava
wel
Explanation 0
String has the following lexicographically-ordered substrings of length :
We then return the first (lexicographically smallest) substring and the last (lexicographically largest) substring as two newline-separated values (i.e., ava\nwel).
The stub code in the editor then prints ava as our first line of output and wel as our second line of output.
Solution:-
import java.util.Scanner;
public class Solution {
public static String getSmallestAndLargest(String s, int k) {
String smallest = "";
String largest = "";
smallest = largest = s.substring(0, k);
for (int i=1; i String substr = s.substring(i, i+k);
if (smallest.compareTo(substr) > 0)
smallest = substr;
if (largest.compareTo(substr) < 0)
largest = substr;
}
return smallest + "\n" + largest;
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.next();
int k = scan.nextInt();
scan.close();
System.out.println(getSmallestAndLargest(s, k));
}
}

Answers

Answer:

Here is the JAVA program:

import java.util.*;  

public class Solution {    // class name

   public static String getSmallestAndLargest(String s, int k) {   //method that takes a string s and and integer k and returns lexicographically smallest and largest substrings

       String smallest = "";   //stores the smallest substring

       String largest = "";   //stores the largest substring

       smallest = largest = s.substring(0, k);  //sets the smallest and largest to substring from 0-th start index and k-th end index of string s

       for(int i = 0;i<=s.length()-k;i++){  //iterates through the string s till length()-k

            String subString = s.substring(i,i+k);  //stores the substring of string s from ith index to i+k th index

            if(i == 0){ //if i is equal to 0

                smallest = subString;              }  //assigns subString to smallest

            if(subString.compareTo(largest)>0){ //checks if the subString is lexicographically greater than largest

                largest = subString;  //sets subString to largest

            }else if(subString.compareTo(smallest)<0)  //checks if the subString is lexicographically less than smallest

                smallest = subString;       }       //sets subString to smallest

       return smallest + "\n" + largest;     }  //returns the lexicographically smallest and largest substrings

   public static void main(String[] args) {  //start of main method

       Scanner scan = new Scanner(System.in);  //creates Scanner object

       String s = scan.next();  //scans and reads input string from user

       int k = scan.nextInt();  //scans and reads integer k from user

       scan.close();  

       System.out.println(getSmallestAndLargest(s, k));      }  }  //calls method by passing string s and integer k to it to display lexicographically smallest and lexicographically largest substring

Explanation:

The program takes a string s and an integer k and passes them to function getSmallestAndLargest that returns the lexicographically smallest and lexicographically largest substring. The method works as follows:

Lets say s = helloworld and k = 3

       smallest = largest = s.substring(0, k);

s.substring(0, k);  is returns the substring from 0th index to k-th index so it gives substring hel

       for(int i = 0;i<=s.length()-k;i++) This loop iterates through the string s till s.length()-k times

s.length()-k is equal to 7 in this example

At first iteration:

i = 0

i<=s.length()-k is true  so program enters the body of loop

String subString = s.substring(i,i+k); this becomes:

subString = s.substring(0,3);

subString = "hel"

if(i == 0) this is true so:

smallest = subString;

smallest = "hel"

At second iteration:

i = 1

i<=s.length()-k is true  so program enters the body of loop

String subString = s.substring(i,i+k); this becomes:

subString = s.substring(1,4);

subString = "ell"

if(subString.compareTo(smallest)<0) this condition is true because the subString ell is compared to smallest hel and it is lexographically less than smallest so :

smallest = subString;

smallest = "ell"

So at each iteration 3 characters of string s are taken and if and else if condition checks if these characters are lexicographically equal, smaller or larger and the values of largest and smallest change accordingly

After the loop ends the statement return smallest + "\n" + largest; executes which returns the smallest and largest substrings. So the output of the entire program with given example is:

ell                                                                                                                                           wor

Here ell is the lexicographically  smallest substring and wor is lexicographically  largest substring in the string helloworld

The screenshot of the program along with its output is attached.

For this assignment, you will create flowchart usingFlowgorithm and Pseudocode for the following program example:You are to design a program for Alexander’s Coffee Shopproviding customer research data. When a customer places an order,the clerk asks the customer for their zip code and age. The clerkenters this data as well as the number of items purchased. Theprogram should operate continuously until the clerk enters a 0 forthe zip code at the end of the day. If the clerk enters an invalidage (defined as less than 10 or more than 100), an error message isdisplayed and the program re-prompts the clerk continuously toenter a valid age. At the end of the program, display the averagecustomer age as well as counts of the number of items ordered bycustomers under the age of 25 and customers 25 and older.

Answers

Answer:

The flowchart is attached

Oredered accordinly with the flowcahrt number

Explaim Why the shape of a cell is hexagonal

Answers

because the hexagon creates a perfect shape to cover an entire area without any overlapping, and can cover an entire area without any gaps.

What are the operating system roles?

Answers

Answer:

keep track of data,time

its the brain of the computer

Which of the following is NOT a period of the Middle Ages?
Early Middle Ages
O Late Middle Ages
O High Middle Ages
O New Middle Ages
allowing is NOT an artifact of the Information Age?

Answers

High middle ages is the answer

The one that is not a period of the Middle Ages is the High Middle Ages. The correct option is c.

What are different ages?

The Middle Ages, which roughly correspond to the years 500 to 1400–1500 BCE, is the term used to describe this time of European history. The phrase was initially used by academics in the 15th century to refer to the time frame between their own era and the dissolution of the Western Roman Empire.

The period between the fall of Imperial Rome and the start of Early Modern Europe is referred to as the “Middle Ages” for this reason. The reason the Middle Ages are known as the Dark Ages is that life was hard and brief in Europe, and contrasted with the orderliness of classical antiquity.

The time period in European history from roughly 500 AD to 1500 AD. This time period's early years are commonly referred to as the Dark Ages.

Therefore, the correct option is c, High Middle Ages.

To learn more about the middle ages, refer to the link:

https://brainly.com/question/26586178

#SPJ6


Select the correct answers.
What are examples of real-time applications?
A.) news updates
B.) blog posts
C.) stock market values
D.) email
E.) online money transfers

Answers

Answer:

B

Explanation:

you can post blog updates in real time as things happen

Answer: Stock market values and news updates

Explanation: These are things that you can follow in real time and that happen in real time (think of something like a livestream)

PLATO/EDMENTUM

is the core of an operating system that controls its basic functions.
O Freeware
O Kernel
Tweaker
O Open source

Answers

Answer:

Explanation:

Tweaker

ANSWER

Its Kernel

Explanation:

i got a 100%

what are the example of malware spreads

a. social network
b. pirated software
c.removable media
d. all of the above​

Answers

The answer has to be
D. All of the above

Examples of malware spreads include all of the options mentioned: social networks, pirated software, and removable media.

The correct option is d.

a. Social networks: Malware can spread through social networks via malicious links or infected attachments shared within messages, posts, or comments. Users may unknowingly click on these links or download infected files, which can then propagate the malware to their devices or their contacts.

b. Pirated software: Malicious actors often distribute malware-infected versions of popular software through illegitimate channels. Users who download and install pirated software are at risk of unknowingly introducing malware onto their systems, as these versions may be modified to include malicious code.

c. Removable media: Malware can also spread through removable media such as USB drives, external hard drives, or even CDs/DVDs. If an infected device or media is connected to a computer, the malware can transfer onto the system, potentially infecting files and spreading further.

Therefore, all of the options (a, b, and c) are examples of how malware can spread, highlighting the importance of practicing safe online habits, avoiding pirated software, being cautious with links and attachments, and regularly scanning removable media to mitigate the risk of malware infections.

To learn more about malware spreads;

https://brainly.com/question/31115061

#SPJ2

guy if you now nitro type pls login and search prouy pro and you will se the legenddetroyer click my team and plssssss come to my team

Answers

Answer:

ok

Explanation:

Answer:

I will join ala you don't disband it. XD

Explanation:

I am You-Drive-Me-Crazy

Write the three working fundamental steps of a computer.​

Answers

Answer:

just tryin' to help you

Explanation:

The three stages of computing are input, processing and output. A computer works through these stages by 'running' a program. A program is a set of step-by-step instructions which tells the computer exactly what to do with input in order to produce the required output.

Backing up and synchronization are the same thing.

A.)True
B.) False​

Answers

Answer: A.)true

Explanation: This is true for a number of reasons, the first being that synced files

What are the benefits of computer?

Answers

Answer:

online toutoring.

helpful games give mind relaxation.

Increase your productivity. ...
Connects you to the Internet. ...
Can store vast amounts of information and reduce waste. ...
Helps sort, organize, and search through information. ...
Get a better understanding of data. ...
Keeps you connected.

A country, called Simpleland, has a language with a small vocabulary of just “the”, “on”, “and”, “go”, “round”, “bus”, and “wheels”. For a word count vector with indices ordered as the words appear above, what is the word count vector for a document that simply says “the wheels on the bus go round and round.”

Please enter the vector of counts as follows: If the counts were ["the"=1, “on”=3, "and"=2, "go"=1, "round"=2, "bus"=1, "wheels"=1], enter 1321211.
1 point

Answers

Answer:

umm that is a todler song

Explanation:

umm that is a todler song that they sing to them when there crying

A country, called Simpleland, has a language with a small vocabulary of just “the”, “on”, “and”, “go”, “round”, “bus”, and “wheels”. As per the given scenario, the vector of counts will be 2111211. The correct option is C.

What are the ways to count items in a vector?

C++ has a built-in function that counts the length of the vector. Size is the function's name ().

It returns the size or total number of elements of the vector that was utilized to create it. There is no need for debate.

The number of observations (rows) includes deleted observations as well. In an SAS data collection, there can be a maximum of 2 63-1 observations, or roughly 9.2 quintillion observations. For the majority of users, going above that limit is quite rare.

The vector of counts in the above scenario will be 2111211.

Thus, the correct option is C.

For more details regarding programming, visit:

https://brainly.com/question/11023419

#SPJ2

Consider a Stop-and-Wait protocol. Assume constant delays for all transmissions and the same delay for packets sent and ACKs sent. Assume no errors occur during transmission.
(a) Suppose that the timeout value is set to 1/2 of what is required to receive an acknowledgement, from the time a packet is sent. Give the complete sequence of frame exchanges when the sender has 3 frames to send to the receiver.
(b) Suppose that the timeout value is sent to 2 times the round trip time. Give the sequence of frame exchanges when 3 frames are sent but the first frame is lost.

Answers

Explanation:

question a) answer:

At the moment when it sends the package, then it has a waiting time for the acknowledgement from the receiver, however, the time will be split in two when the frameset size becomes two, meaning that two packages have been sent together, causing the receiver to acknowledge only one package.

question b) answer:

The timeout is equal to two times.

In cases when the frame size is 3, the frame will be lost since the timeout turns to be 2 times. Because the sender has to wait for the acknowledgement, therefore it will send other of the parcels.

Match letters from column B to Column A by looking at the picture above.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This question is about mapping correct terms with their number in the given picture. The correct matching of Column A and Column B is given below

Column A                               Column B

Horizontal axis                        3

Legend                                    4

Vertical axis                             2

Chart Data                               1

c Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hint: Call FindMax() twice in an expression.

Answers

Answer:

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);

Explanation:

In the statement, maxSum is a double type variable which is assigned the maximum of the two variables numA numB PLUS the maximum of the two variables numY numZ using which are found by calling the FindMax function. The FindMax() method is called twice in this statement one time to find the maximum of numA and numB and one time to find the maximum of numY numZ. When the FindMax() method is called by passing numA and numB as parameters to this method, then method finds if the value of numA is greater than that of numB or vice versa. When the FindMax() method is called by passing numY and numZ as parameters to this method, then method finds if the value of numY is greater than that of numZ or vice versa. The PLUS + sign between the two method calls means that the resultant values returned by the FindMax() for both the calls are added and the result of addition is assigned to maxSum. The screenshot of program along with its output is attached.

what is the provincial capital of lumbini province​

Answers

Answer:

hope it helps..

Explanation:

Butwal(recently changed again) , Rupendhai District

Create an interface called Runner. The interface has an abstract method called run() that displays a message describing the meaning of run to the class. Create classes called Machine, Athlete, and PoliticalCandidate that all implement Runner.
The run() should print the following in each class:
Machine - When a machine is running, it is operating.
Athlete - An athlete might run in a race, or in a game like soccer.
PoliticalCandidate - A political candidate runs for office.
----------------------------------------------------------------------------------------------------
public class Athlete implements Runner
{
public void run()
{
// write your code here
}
}
--------------------------------------------------------------------------------------
public class DemoRunners
{
public static void main(String[] args)
{
Machine runner1 = new Machine();
Athlete runner2 = new Athlete();
PoliticalCandidate runner3 = new PoliticalCandidate();
runner1.run();
runner2.run();
runner3.run();
}
}
------------------------------------------------------------------------------------------
public class Machine implements Runner
{
public void run()
{
// write your code here
}
}
----------------------------------------------------------------------------------------------------
public class PoliticalCandidate implements Runner
{
public void run()
{
// write your code here
}
}
----------------------------------------------------------------------------------------------------
public interface Runner
{
// write your code here
}
----------------------------------------------------------------------------------------------------

Answers

Answer:

Please find the code and its output in the attached file.

Explanation:

In the above-given code, an interface "Runner" is defined, inside the interface, an abstract method run is declared.

In the next step, three class "Athlete, Machine, and PoliticalCandidate" s defined that implements the run method, and use the print message that holds a given value as a message.

In the next step, a class "DemoRunners" is defined, and inside the main method, the three-class object is declared, which calls the run method.

 

The Environmental Master Equation includes all of the following terms except:
O Resource use per person
O Population
•Percent of resource emitted into the atmosphere
•Environmental impact per unit of resource use

Answers

Answer:  [C]:  " percent of resource emitted into the atmosphere ."

________________________

Explanation:

In the "Environmental Master Equation"—

Note that the:

    "Environmental impact" ;

            =  (population) * (resource use per unit population) *

              (environmental impact per unit of resource use) .

________________________

The question asks:  

   "The Environmental Master Equation includes all of the following terms —EXCEPT ...[with 4 (four) answer choices following.]."

________________________

Consider the given answer choices:

 [A]:  "resource user per person"—which is the same as"

          "(resource use per UNIT [emphasis added] population" ;

              — which does appear in the equation;

                   → so we can rule out "Choice:  [A]."

________________________

 [B]: "population" —this is included within the equation; so we can rule out "Choice:  [B]."

________________________

 [C]: "percentage of resource emitted into the atmosphere" ;  

    Note:  This clearly does NOT appear within the equation; so this is a likely answer choice.

________________________

Note: There is one more answer choice—so let us examine:

________________________

 [D]: "environmental impact per unit of resource use" —this is included within the equation, so we can rule out "Choice:  [D]."

________________________

   Furthermore, the particular answer choices given—A, B, and D ; constitute all elements within the "Environmental Master Equation."

________________________

As such: The correct answer is:  

             [C]:  "percent of resource emitted into the atmosphere."

________________________

Hope this is helpful to you!

  Best wishes in your academic pursuits!

________________________

Answer:

•Percent of resource emitted into the atmosphere

Explanation:

Hope this will help

Create a TeeShirt class for Toby’s Tee Shirt Company. Fields include:

orderNumber - of type int size - of type String color - of type String price - of type double Create set methods for the order number, size, and color and get methods for all four fields. The price is determined by the size: $22.99 for XXL or XXXL, and $19.99 for all other sizes. Create a subclass named CustomTee that descends from TeeShirt and includes a field named slogan (of type String) to hold the slogan requested for the shirt, and include get and set methods for this field.

Answers

Answer:

Here is the TeeShirt class:

public class TeeShirt{  //class name

   private int orderNumber;  // private member variable of type int of class TeeShirt to store the order number

   private String size;  // to store the size of tshirt

   private String color;  //  to store the color of shirt

   private double price;  // to store the price of shirt

   public void setOrderNumber(int num){  //mutator method to set the order number

       orderNumber = num;     }    

   public void setColor(String color){  //mutator method to set the color

       this.color = color;        }      

       

     public void setSize(String sz){  //mutator method to set the shirt size

   size = sz;  

   if(size.equals("XXXL") || size.equals("XXL")){  //if shirt size is XXL or XXXL

       price = 22.99;  // set the price to 22.99 if shirt size is XXL or XXXL

   }else{  //for all other sizes of shirt

       price = 19.99;     }  }  //sets the price to 19.99 for other sizes

   public int getOrderNumber(){  //accessor method to get the order number stored in orderNumber field

       return orderNumber;     }  //returns the current orderNumber

   public String getSize(){  //accessor method to get the size stored in size field

       return size;     }  //returns the current size

   public String getColor(){  //accessor method to get the color stored in color field

       return color;     }  //returns the current color

   public double getPrice(){  //accessor method to get the price stored in price field

       return price;      }  } //returns the current price

Explanation:

Here is the sub class CustomTee:

public class CustomTee extends TeeShirt {  //class CustomTee that inherits from class TeeShirt

private String slogan;   //private member variable of type String of class CustomTee to store slogan

public void setSlogan(String slgn) {  //mutator method to set the slogan

slogan = slgn; }

public String getSlogan() {  //accessor method to get the slogan stored in slogan field

return slogan;}  } //returns the current slogan

Here is DemoTees.java

import java.util.*;

public class DemoTees{  //class name

public static void main(String[] args)  {  //start of main method

TeeShirt tee1 = new TeeShirt();  //creates object of class TeeShirt named tee1

TeeShirt tee2 = new TeeShirt(); //creates object of class TeeShirt named tee2

CustomTee tee3 = new CustomTee(); //creates object of class CustomTee named tee3

CustomTee tee4 = new CustomTee();  //creates object of class CustomTee named tee4

tee1.setOrderNumber(100);  //calls setOrderNumber method of class TeeShirt using object tee1 to set orderNumber to 100

tee1.setSize("XXL");  //calls setSize method of class TeeShirt using object tee1 to set size to XXL

tee1.setColor("blue");  //calls setColor method of class TeeShirt using object tee1 to set color to blue

tee2.setOrderNumber(101);  //calls setOrderNumber method of class TeeShirt using object tee2 to set orderNumber to 101

tee2.setSize("S");  //calls setSize method of class TeeShirt using object tee2 to set size to S

tee2.setColor("gray");  //calls setColor method of class TeeShirt using object tee2 to set color to gray

tee3.setOrderNumber(102);   //calls setOrderNumber method of class TeeShirt using object tee3 of class CustomTee to set orderNumber to 102

tee3.setSize("L");  //calls setSize method of class TeeShirt using object tee3 to set size to L

tee3.setColor("red");  //calls setColor method of class TeeShirt using object tee3 to set color to red

tee3.setSlogan("Born to have fun");  //calls setSlogan method of class CustomTee using tee3 object to set the slogan to Born to have fun

tee4.setOrderNumber(104);  //calls setOrderNumber method of class TeeShirt using object tee4 of class CustomTee to set orderNumber to 104

tee4.setSize("XXXL");  //calls setSize method to set size to XXXL

tee4.setColor("black");  //calls setColor method to set color to black

tee4.setSlogan("Wilson for Mayor");  //calls setSlogan method to set the slogan to Wilson for Mayor

display(tee1);  //calls this method passing object tee1

display(tee2);  //calls this method passing object tee2

displayCustomData(tee3);  //calls this method passing object tee3

displayCustomData(tee4);  }   //calls this method passing object tee4

public static void display(TeeShirt tee) {  //method display that takes object of TeeShirt as parameter

System.out.println("Order #" + tee.getOrderNumber());  //displays the value of orderNumber by calling getOrderNumber method using object tee

System.out.println(" Description: " + tee.getSize() +  " " + tee.getColor());  //displays the values of size and color by calling methods getSize and getColor using object tee

System.out.println(" Price: $" + tee.getPrice()); }  //displays the value of price by calling getPrice method using object tee

public static void displayCustomData(CustomTee tee) {  //method displayCustomData that takes object of CustomTee as parameter

display(tee);  //displays the orderNumber size color and price by calling display method and passing object tee to it

System.out.println(" Slogan: " + tee.getSlogan());  } } //displays the value of slogan by calling getSlogan method using object tee

In this exercise we have to use the knowledge in computational language in JAVA to write the following code:

We have the code can be found in the attached image.

So in an easier way we have that the code is

public class TeeShirt{  

  private int orderNumber;

  private String size;  

  private String color;

  private double price;  

  public void setOrderNumber(int num){  

      orderNumber = num;     }    

  public void setColor(String color){  

      this.color = color;        }  

    public void setSize(String sz){  

  size = sz;  

  if(size.equals("XXXL") || size.equals("XXL")){  

      price = 22.99;  

  }else{

      price = 19.99;     }  }

  public int getOrderNumber(){  

      return orderNumber;     }

  public String getSize(){  

      return size;     }  

  public String getColor(){  

      return color;     }  

  public double getPrice(){

      return price;      }  }

public class CustomTee extends TeeShirt {  

private String slogan;  

public void setSlogan(String slgn) {

slogan = slgn; }

public String getSlogan() {

return slogan;}  }

import java.util.*;

public class DemoTees{

public static void main(String[] args)  {

TeeShirt tee1 = new TeeShirt();

TeeShirt tee2 = new TeeShirt();

CustomTee tee3 = new CustomTee();

CustomTee tee4 = new CustomTee();

tee1.setOrderNumber(100);  

tee1.setSize("XXL");  

tee1.setColor("blue");  

tee2.setOrderNumber(101);

tee2.setSize("S");  

tee2.setColor("gray");  

tee3.setOrderNumber(102);  

tee3.setSize("L");

tee3.setColor("red");  

tee3.setSlogan("Born to have fun");  

tee4.setOrderNumber(104);  

tee4.setSize("XXXL");  

tee4.setColor("black");  

tee4.setSlogan("Wilson for Mayor");  

display(tee1);  

display(tee2);

displayCustomData(tee3);

displayCustomData(tee4);  }  

public static void display(TeeShirt tee) {  

System.out.println("Order #" + tee.getOrderNumber());

System.out.println(" Description: " + tee.getSize() +  " " + tee.getColor());  

System.out.println(" Price: $" + tee.getPrice()); }

public static void displayCustomData(CustomTee tee) {

display(tee);  

System.out.println(" Slogan: " + tee.getSlogan());  } }

See more about JAVA at brainly.com/question/18502436

Write a program named as calcPrice.c that formats product information entered by the user and calculate the total amount of purchase.

Answers

Answer:

Here is the calcPrice.c program:

#include <stdio.h>   //to use input output functions

int main(void)  {  //start of main method

   int itemNo, month, day, year, quantity;  //declares variables to hold item number, quantity, and date

   float unitPrice; //declare variable to hold price per unit

   printf("Enter item number: ");  // prompts user to enter item number

   scanf("%d", &itemNo);  //reads item number from user and stores it in itemNo variable

   printf("Enter unit price: ");  // prompts user to enter unit price

   scanf("%f", &unitPrice);  //reads input unit price and stores it in unitPrice variable

   

    printf("Enter quantity: ");  //prompts user to enter quantity

   scanf("%d", &quantity);  //reads input quantity and stores it in quantity variable

   printf("Enter purchase date (mm/dd/yyyy): ");  //prompts user to enter purchase date

   scanf("%d/%d/%d", &month, &day, &year);  //reads input date and stores it in month, day and year variables

    float totalAmount = unitPrice * quantity;  //computes the total amount

   printf("\nItem\tUnit Price\tQTY\tPurchase Date\tTotal Amount\n");  //displays the item, unit price, qty, purchase data and total amount with tab space between each

   printf("%d\t$%5.2f\t%d\t%.2d/%.2d/%d\t$%5.2f\n", itemNo, unitPrice,quantity, month, day, year,totalAmount);   }    //displays the values of itemNo, unitPrice, quantity, month, day, year and computed totalAmount with tab space between each

Explanation:

Lets suppose user enters 583 as item number, 13.5 as unit price, 2 as quantity and 09/15/2016 as date so

itemNo = 583

unitPrice = 13.5

quantity = 2

month = 09

day = 15

year = 2016

totalAmount is computed as:

  totalAmount = unitPrice * quantity;

 totalAmount = 13.5* 2

totalAmount = 27.00

Hence the output of the entire program is:

Item    Unit Price      QTY     Purchase Date   Total Amount      

583     $  13.50           2           09/15/2016         $  27.00  

The screenshot of the program along with its output is attached.

best answer brainliest :)

ridiculous answers just for points will be reported

thank you! Most jobs in information technology require expertise in _____.


most of the layers

all of the layers

one layer

a couple of the layers

Answers

Answer:

all of the layers

Explanation:

Answer:

a couple of the layers

Explanation: says it in the first sentence in the last paragraph of this image

Using Phyton

Write a program with the following functions.

function 1: Accepts 2 strings as arguments. returns true if the second string is a part of the first string.

Answers

def something(string1, string2):

return True if string2 in string1 else False

This would be the most concise way of writing this function.

Other Questions
Food bank usage in Britain has grown dramatically over the past decade. The number of users, in thousands, of the largest food bank in year t is estimated to be N(t) = 1.3e0.81t , where t is the number of years since 2006.25 (a) What does the 1.3 represent in this context? Give units. (b) What is the continuous growth rate of users per year? (c) What is the annual percent growth rate of users per year? (d) Using only your answer for part (c), decide if the doubling time is more or less than 1 year. Does the ocean always have the same surface area and volume? Why? The endocrine glandsa. transmit information from the sensory organs to the brain. b. secrete hormones directly into the bloodstream. c. are instrumental in producing myelin, which protects the neurons. d. secrete neurotransmitters into the brain. Examine the diagram. It is not drawn to scale.In the diagram shown, mZ1 = 30 and m25 = 120.What is the sum of the measures of 24, 25, and 26?4125ondegreesIdentify the following angle measures.m22= v degreesm24 =v degrees33m26 =v degrees6 1) The cartoon seen here refers to the "Spoils System." Which of theseBEST describes the Spoils System?A)appointing unqualified people to leadB)giving governmental positions to politically loyalindividualsCOgaining the favor of the electorate by promising themimprovementsDusing underhanded tactics to win congressional andpresidential elections The table shows the total number y (in billions) of U.S. movie admissions each year for x years. Use a graphing calculator to find an equation of the line of best fit for the data. Round each value to the nearest hundredth. The line of best fit is y = _(I need this by 11 pm please) Women who served in the WASP during World War II wereO Air Force service pilots.O Air Force service police.O Air Force typists.O Air Force radio dispatllers. common lit the lottery A large round object that moves around a star, such as the Sun * spanish help please imagine that you're giving a news report about how you spent the day yesterday. Name four things that happened during the day and use the preterite to report on them. You should write and record four sentences. You have made our social fabric stronger, our families healthier and safer, our people more prosperous. You, the American people, have made our passage into the global information age an era of great American renewal. Which rhetorical appeal does Clinton primarily use in this excerpt? PLEASE HELP! WILL MARK BRAINLIEST!! When thermal energy is removed from a system, what happens to thetemperature and the average kinetic energy of the system?Temperature decreases, average kinetic energy increasesTemperature decreases, average kinetic energy decreasesTemperature increases, average kinetic energy increasesTemperature increases, average kinetic energy decreases Soil is an example of a:a. solution b. heterogeneous mixture c. solid solution Someone Help Me Please. ? Read the following sentences, and identify the error. a. Paolo recruited job applicants for the company that showed promise. The error in this sentence is a:_________ . b. We will be visiting our accounts in California, Oregon, and visiting our accounts in Washington. The error in this sentence is a:________ . Before you decide whether to use passive or active voice, you should consider the purpose of your message and the nature of the situation. Read the scenario, and then fill in the blanks. You work for a printing company, and you realize that your colleague sent incorrect price quotes to a client. You begin to write an e-mail to the client to apologize for the mistake. You want to remedy the situation without criticizing your colleague. The sentence excerpted from the e-mail uses ______________ voice. Given the purpose of your message, this voice ___________ appropriate. Which best describes the location of the famous ceiling that Michelangelo painted?inside the Sistine Chapeloutside Rome, Italyinside St. Peter's Basilicaoutside Vatican City Never Going To Give You Up never going to let you down never gonna run around baby nor desert you Rick roll.. so far 72 % of 300 tickets have been sold for the concert. How many tickets have been sold? The purpose of a primary election is toA)choose party candidates for the general election.B)determine a winner when no candidate received a majority of the vote.give the voters a chance to express their opinions on a specific issue.D)decide among the candidates representing the different political parties.