1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
KATRIN_1 [288]
2 years ago
8

In a paragraph, describe in detail a practical real-world example of where you would implement a singly-linked list and why a si

ngly-linked list is best for this use. Do not list the properties of a singly-linked list....
Rather identify a real-world example or application. If you identify this through research, cite your source.
Computers and Technology
1 answer:
frosja888 [35]2 years ago
3 0

Answer:

travel

Explanation:

One real world example of a singly-linked list would be travel. Imagine that you want to take a trip to your nearest neighbor state. To do so you would need to take a 2 buses and a train, but you can't just take any or in any order you wish. You first need to take the first bus at your current location, get off at the train station, take that train to the final stop, get off and take the bus to the final destination. Meaning there is a sequence of connected events that you must follow in order to get to your destination and the same opposite sequence of events to get back. This is exactly like a singly-linked list.

You might be interested in
Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text
FromTheMoon [43]

Answer:

<h2>I would recommend Python Programming language</h2>

Explanation:

The major reason i recommend python is that It has a ton of resources, and community support, such that it is practically impossible to get stuck while carrying out a project

Python is easy,and lets you build more functions with fewer lines of code.

More so, provides a stepping stone to learning other code and it is a very  flexible language

3 0
3 years ago
The following code does not work as intended. It is meant to input two test grades and return the average in decimal format:
vredina [299]

Answer:

Type casting error

Explanation:

Logically, the program is correct and it is expected to return the average value. However, test1 and test2 are int values and when you applies any algebraic expression on Int, it will result into Int.

So, in this part (test1 + test2 )/2, two integers are adding and the final result is still an integer and this part will act as an integer even if you multiple or divide with any external number.

For example,

test1 = 4

test2 = 5

test1 + test2 = 9

Now, if you divide it by 2, it will still react as an integer portion. So, 9/2 would result in 4 instead of 4.5. All the calculation is done on the right side before assigning it to a double variable. Therefore, the double variable is still getting the int value and your program is not working correctly.

The solution is to typecast the "(test1 + test2 )/2" portion to double using Double.valueOf(test1 + test2)/2 ;

I have also attached the working code below.

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 System.out.println("Hello World");

 Scanner scan = new Scanner (System.in);

 int test1 = scan.nextInt();

       int test2 = scan.nextInt();

       double average = Double.valueOf(test1 + test2)/2 ;

       System.out.println("Answer: " + average);

}

}

4 0
3 years ago
[20 pts] Write the function rectangle(perimeter, area), which takes two positive integers, perimeter and area. It returns an int
MrRissso [65]

Hi, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.

Answer:

import math

def rectangle(perimeter, area):

   l1_1 = (perimeter+math.sqrt((perimeter**2)-(16*area)))/4

   l1_2 = (perimeter-math.sqrt((perimeter**2)-(16*area)))/4

   l2_1 = area/l1_1

   l2_2 = area/l1_2

   print(l1_1,l2_1)

   print(l1_2,l2_2)

   if l1_1.is_integer() and l2_1.is_integer() and l1_1>0 and l2_1>0:

       return(int(max(l1_1,l2_1)))

   elif l1_2.is_integer() and l2_2.is_integer() and l1_2>0 and l2_2>0:

       return(int(max(l1_2,l2_2)))

   else:

       return(None)

Explanation:

  • We import math to make basic operations
  • We define the rectangle function that receives perimeter and area
  • We calculate one of the sides (l1_1) of the rectangle using the quadratic equation to solve 2h^2 - ph + 2a = 0
  • We calculate the second root of the quadratic equation for the same side (l1_2)
  • We calculate the second side of the rectangle using the first root on w = a/h
  • We calculate the second side of the rectangle using the second root on w= a/h
  • We verify that each component of the first result (l1_1, l2_1) is an integer (using the build-in method .is_integer) and greater than 0, if True we return the maximum value between them (using the max function) as w
  • If the first pair of sides evaluate to False we check the second root of the equation and if they meet the specification we return the max value
  • if all the if statements evaluate to false we return None to indicate that not positive or integer sides were found

7 0
3 years ago
8.18 **zyLab: Schedule Generator Write this program using an IDE. Comment and style the code according to the CS 200 Style Guide
Lera25 [3.4K]

Answer:

huh

Explanation:

sfdghjklhgfdsghjkhgfdsfghjk

3 0
3 years ago
Sending an identical message in an e-mail blast to all customers is an example of
disa [49]

Answer:

Broadcast message

Explanation:

A broadcast message is an identical message sent to a lot of recipients. When it is an email, it can be sent in Carbon Copy (Cc) or a Blind Carbon Copy (Bcc) form.

With the<em> Carbon Copy</em>, every recipients will be notified about the other recipients. In most cases all the email usernames of the recipients will be sent to all the recipients individually.

With the <em>Blind Carbon Copy</em>, every individual sees the message as he/she received it alone. The individual is not notified about the other recipients.

8 0
3 years ago
Other questions:
  • Does toontown rewritten carry spyware or malware
    9·1 answer
  • When do we use an if- statement ​
    8·2 answers
  • Lesson 1 (4.0 points)
    13·2 answers
  • A program written in a(n) procedural language consists of sequences of statements that manipulate data items. __________________
    9·1 answer
  • Consider the following C code fragment:
    10·1 answer
  • Accepting criticism is a trait of what people?
    5·1 answer
  • What is responsible for recording an image of an object with camera <br> Pls I neeed it right know
    8·1 answer
  • Select the correct answer.
    10·1 answer
  • A software program that allows you to create professional looking multimedia presentations. Question 1 options: Excel 365 Word 3
    6·1 answer
  • What is the answer for this
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!