Questions
IN JAVA LANGUAGE Linked List-Based Queue Implementation Implement Queue using a Linked List. Use the language...

IN JAVA LANGUAGE

Linked List-Based Queue Implementation

Implement Queue using a Linked List.

  • Use the language library LinkedList
  • Queue methods will call the LinkedList methods
  • You can use string as the object

Instead of using an array, as the QueueLab did, here you will use a Linked List from your language's library. Implement all the methods of Stack : enqueue(), dequeue(), size(), printQueue(), etc, using calls to the linked list methods that correspond to the actions need. In the array implementation, you wrote code to manipulate the array. For this linked list implementation, methods already exist.

Before the underlying implementation of queue was array, now the underlying implementation of queue will be Linked list.

In: Computer Science

7.24 LAB: Triangle area comparison (classes) Language: C++ Given class Triangle (in files Triangle.h and Triangle.cpp),...

7.24 LAB: Triangle area comparison (classes)

Language: C++

Given class Triangle (in files Triangle.h and Triangle.cpp), complete main() to read and set the base and height of triangle1 and of triangle2, determine which triangle's area is larger, and output that triangle's info, making use of Triangle's relevant member functions.

Ex: If the input is:

3.0 4.0
4.0 5.0

where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is:

Triangle with larger area:
Base: 4.00
Height: 5.00
Area: 10.00

In: Computer Science

In the C programming language: Pretend you are an astrophysicist making a report on the distances...

In the C programming language:

Pretend you are an astrophysicist making a report on the distances to the 50 brightest stars.
You need to print out a nice table sorted by distance to include in your report.

Using data in input.txt, write a program that can read in the included file input.txt.

Use scanf or fscanf (or any other function you prefer) to read the comma separated values (CSV) into an array of structs representing each record.

Once all records are loaded, sort the list by the distance field. Alternatively, you can keep the array
sorted by its distance during reading. Use any sorting function you want.

Save the data sorted by the distance field (lowest to highest) in another file called "distance.txt".
Save only the following fields in this order:

   Distance
   Name
   Bayer Name
   right ascension
   declination

Make sure that the columns line up nicely and that the header is printed before the data.

input.txt contains:

Rank,Star Name, Bayer Name, Visual Mag., Abs. Mag., Dist. (ly), Spectral Type, Lum. (Sol), Mass (Sol), Diam. (Sol), RA (hr_min), Dec (deg)
1, Sirius, Alp CMa, -1.44, 1.45, 8.6, A1V, 25, 2.0, 1.7, 06h 45m, -16.7
2, Canopus, Alp Car, -0.62, -5.53, 310, F0Ib, 13600, 8.5, 65, 06h 24m, -52.7
3, Rigil Kent., Alp Cen, -0.28c, 4.34, 4.4, G2V+K1V, 1.5, 1.1, 1.2, 14h 40m, -60.8
4, Arcturus, Alp Boo, -0.05v, -0.31, 36.7, K2III, 170, 1.1, 26, 14h 16m, +19.2
5, Vega, Alp Lyr, 0.03v, 0.58, 25.3, A0V, 37, 2.1, 2.3, 18h 37m, +38.8
6, Capella, Alp Aur, 0.08v, -0.48, 42.2, G5III+G0II, 79, 2.7, 12, 05h 17m, +46.0
7, Rigel, Bet Ori, 0.18v, -6.69, 770, B8Ia, 66000, 17, 78, 05h 15m, -8.2
8, Procyon, Alp CMi, 0.40, 2.68, 11.4, F5IV-V, 7.7, 1.5, 2.0, 07h 39m, +5.2
9, Betelgeuse, Alp Ori, 0.45v, -5.14, 430, M2Ib, 105000, 18, 936, 05h 55m, +7.4
10, Achernar, Alp Eri, 0.45v, -2.77, 144, B3V, 3300, 6-8, 10, 01h 38m, -57.2
11, Hadar, Bet Cen, 0.61v, -5.42, 525, B1III, 16000, 10.7, 8, 14h 04m, -60.4
12, Altair, Alp Aql, 0.76v, 2.20, 16.8, A7V, 10.6, 1.8, 1.8, 19h 51m, +8.9
13, Acrux, Alp Cru, 0.77c, -4.19, 320, B0.5IV+B1V, 25000, 14, ?, 12h 27m, -63.1
14, Aldebaran, Alp Tau, 0.87, -0.63, 65.1, K5III, 425, 1.7, 44.2, 04h 36m, +16.5
15, Spica, Alp Vir, 0.98v, -3.55, 260, B1V+B2V, 13400, 11, 7.8, 13h 25m, -11.2
16, Antares, Alp Sco, 1.06v, -5.28, 605, M1Ib+B4V, 65000, 15.5, 800, 16h 29m, -26.4
17, Pollux, Bet Gem, 1.16, 1.09, 33.7, K0III, 32, 1.9, 8, 07h 45m, +28.0
18, Fomalhaut, Alp PsA, 1.17, 1.74, 25.1, A3V, 17.7, 2.1, 1.8, 22h 58m, -29.6
19, Deneb, Alp Cyg, 1.25v, -8.73, 3200, A2Ia, 54000, 20, 110, 20h 41m, +45.3
20, Mimosa, Bet Cru, 1.25v, -3.92, 350, B0.5III, 34000, 14, 8, 12h 48m, -59.7
21, Regulus, Alp Leo, 1.36, -0.52, 77.5, B7V, 150, 3.5, 3.2, 10h 08m, +12.0
22, Adhara, Eps CMa, 1.50, -4.10, 430, B2II, 20000, 10, ?, 06h 59m, -29.0
23, Castor, Alp Gem, 1.58c, 0.59, 51.5, A1V+A2V, 30/14, 2.2/1.7, 2.3/1.6, 07h 35m, +31.9
24, Gacrux, Gam Cru, 1.59v, -0.56, 87.9, M3.5III, 1500, 3, 113, 12h 31m, -57.1
25, Shaula, Lam Sco, 1.62v, -5.05, 700, B2IV, ?, 10.4, 6.2, 17h 34m, -37.1
26, Bellatrix, Gam Ori, 1.64, -2.72, 240, B2III, 21500, 8, 5.7, 05h 25m, +6.3
27, Elnath, Bet Tau, 1.65, -1.37, 131, B7III, 70, 4.5, 5.5, 05h 26m, +28.6
28, Miaplacidus, Bet Car, 1.67, -0.99, 111, A2III, 210, 3, 5.7, 09h 13m, -69.7
29, Alnilam, Eps Ori, 1.69v, -6.38, 1300, B0Ia, 375000, 40, 26, 05h 36m, -1.2
30, Alnair, Alp Gru, 1.73, -0.73, 101, B7IV, 380, 4, 3.6, 22h 08m, -47.0
31, Alnitak, Zet Ori, 1.74c, -5.26, 820, O9.5Ib+B0I, 100000, 28, 20, 05h 41m, -1.9
32, Regor, Gam Vel, 1.75v, -5.31, 840, WC8+O9Ib, 100000, 30, 13, 08h 10m, -47.3
33, Alioth, Eps UMa, 1.76v, -0.21, 80.9, A0IV, 108, 3, 3.7, 12h 54m, +56.0
34, Kaus Aust., Eps Sgr, 1.79, -1.44, 145, B9.5III, 375, 5, 7, 18h 24m, -34.4
35, Mirfak, Alp Per, 1.79, -4.50, 590, F5Ib, 5400, 11, 56, 03h 24m, +49.9
36, Dubhe, Alp UMa, 1.81, -1.08, 124, K0III+F0V, 300, 4, 30, 11h 04m, +61.8
37, Wezen, Del CMa, 1.83, -6.87, 1800, F8Ia, 50000, 17, 200, 07h 08m, -26.4
38, Alkaid, Eta UMa, 1.85, -0.60, 101, B3V, 700, 6, 1.8, 13h 48m, +49.3
39, Sargas, The Sco, 1.86c, -2.75, 270, F1II, 960, 3.7, 20, 17h 37m, -43.0
40, Avior, Eps Car, 1.86v, -4.58, 630, K3II+B2V, 6/11 K, 4.6/16, 153/6, 08h 23m, -59.5
41, Menkalinan, Bet Aur, 1.90v, -0.10, 82.1, A2IV, 48, 2.4, 2.8, 06h 00m, +44.9
42, Atria, Alp TrA, 1.91, -3.62, 415, K2Ib-II, 5500, 7, ?, 16h 49m, -69.0
43, Koo She, Del Vel, 1.93, -0.01, 79.7, A0V, ?, ?, ?, 08h 45m, -54.7
44, Alhena, Gam_Gem, 1.93, -0.60, 105, A0IV, 160, 2.8, 4.4, 06h 38m, +16.4
45, Peacock, Alp Pav, 1.94, -1.81, 180, B0.5V+B2V, 2100, 5, 4.4, 20h 26m, -56.7
46, Polaris, Alp UMi, 1.97v, -3.64, 430, F7Ib-II, 2200, 7.5, 30, 02h 32m, +89.3
47, Mirzam, Bet CMa, 1.98v, -3.95, 500, B1III, 19000, ?, ?, 06h 23m, -18.0
48, Alphard, Alp Hya, 1.99, -1.69, 180, K3II, ?, 3.0, 50.5, 09h 28m, -8.7
49, Algieba, Gam Leo, 2.01, -0.92, 126, K0III+G7II, 320/50, 1.23, 32, 10h 20m, +19.8
50, Hamal, Alp Ari, 2.01, 0.48, 65.9, K2III, 90, 2, 15, 02h 07m, +23.5

In: Computer Science

7.28 LAB: Artwork label (classes/constructors). Written in C++ Given main(), complete the Artist class (in files...

7.28 LAB: Artwork label (classes/constructors). Written in C++

Given main(), complete the Artist class (in files Artist.h and Artist.cpp) with constructors to initialize an artist's information, get member functions, and a PrintInfo() member function. The default constructor should initialize the artist's name to "None" and the years of birth and death to 0. PrintInfo() should display Artist Name, born XXXX if the year of death is -1 or Artist Name (XXXX-YYYY) otherwise.

Complete the Artwork class (in files Artwork.h and Artwork.cpp) with constructors to initialize an artwork's information, get member functions, and a PrintInfo() member function. The constructor should by default initialize the title to "None", the year created to 0. Declare a private field of type Artist in the Artwork class.

Ex. If the input is:

Pablo Picasso
1881
1973
Three Musicians
1921

the output is:

Artist: Pablo Picasso (1881-1973)
Title: Three Musicians, 1921

If the input is:

Brice Marden
1938
-1
Distant Muses
2000

the output is:

Artist: Brice Marden, born 1938
Title: Distant Muses, 2000

In: Computer Science

Design a GUI application for the Bank Account assignment you did in the File IO module....

Design a GUI application for the Bank Account assignment you did in the File IO module.

It can be simple as a single user app with three buttons - checkBalance, Withdraw, Deposit - textbox for entering the amount.

On Click of buttons, you can show the current balance in a dialog box.

If you have more interest, you can expand it further according to your design of the application

In python

Please show codes and output.

The calculator must be in a standard size not too small not to big

In: Computer Science

*Not in C++ Language! Pleaseeee in Java?!!* Programming Exercise 3.20 required you to design a PID...

*Not in C++ Language! Pleaseeee in Java?!!*

Programming Exercise 3.20 required you to design a PID manager that allocated a unique process
identifier to each process. Exercise 4.20 required you to modify your solution to Exercise 3.20 by writing
a program that created a number of threads that requested and released process identifiers. Now
modify your solution to Exercise 4.20 by ensuring that the data structure used to represent the
availability of process identifiers is safe from race conditions. Use Pthreads mutex locks.

if there is any questions, leave a comment. Thank you.

In: Computer Science

We are going to create our own implementation of the game “FloodIt”. Several versions of this...

We are going to create our own implementation of the game “FloodIt”. Several versions of this game can be found, for example a version for android, on which this description is based, here. Several Web versions are available

In this game, a square board is filled with dots, each having one of six possible colours. The players initially “captures” the top left dot. The player keeps choosing one of the six colours. Each time a colour is chosen, the dots that have already been captured turn into that colour. Each dot that is a neighbour1 of a captured dot, and whose colour matches the newly selected colour becomes itself captured. The game ends once the entire board is captured (the board is “flooded” because all the dots have the same colour). As the game can only progress (a captured dot cannot be lost), the issue of the game is certain. The goal is thus to flood the board in as few steps as possible.

https://drive.google.com/file/d/0B4hEHn5tHkyxYzktNUYxbUt4Qkk/view?usp=sharing

In: Computer Science

Prepare a class and tester that simulates and tabulates the result of repeatedly throwing two dice.  Recall...

Prepare a class and tester that simulates and tabulates the result of repeatedly throwing two dice.  Recall a dice, a six-sided cube with 1 through 6 dots on each side.

Using a now familiar looping user experience, the user enters the number of throws. Then, the system simulates the throws and displays the results using a frequency distribution chart. For instance:

Please, use this statement to get the dice action started!

String[] labels = {"Snake Eyes", "Ace Deuce", "Hard Four", "Fever Five", "Easy Six", "Natural Seven", "Easy Eight", "Nina", "Easy Ten", " Yo-leven", "Boxcars"};

In: Computer Science

Writ 3 complete requirement of each type : - functional - non- functional - domain requirement...

Writ 3 complete requirement of each type :
- functional
- non- functional
- domain requirement
About a pills machine

In: Computer Science

Write Python code that checks if an existing variable letter is a lowercase vowel. If it...

Write Python code that checks if an existing variable letter is a lowercase vowel. If it is a, e, i, o, or u and print out "Yes, it is a lowercase vowel". If the letter is y, print out "The letter is a consonant". If the letter is anything else, print out "No, the letter is not a vowel".

(language python)

In: Computer Science

Write a python program that will ask the user to enter as many positive and negative...

Write a python program that will ask the user to enter as many positive and negative numbers and this process will only stop when the last number entered is -999. Use a while loop for this purpose. Your program should compute three sums; the sum of all numbers, sum of all positive numbers, and the sum of all negative numbers and display them. It should also display the count of all numbers, count of all positive numbers, and count of all negative numbers. Finally, it should compute and display the average of all numbers, average of all positive numbers, and average of all negative numbers.

In: Computer Science

A program, or software, consists of a series of related instructions, organized for a common purpose,...

A program, or software, consists of a series of related instructions, organized for a common purpose, that tells the computer what tasks to perform and how to perform them. An application, or app, sometimes called application software, consists of programs designed to make users more productive and/or assist them with personal tasks. The purpose of this discussion is to talk about the applications you use for work, school and play and the license agreements you agreed to when using them.

DQ Post

  • Post the details on three Apps you use the most for School, Work, or Play.
  • What do you use them for?
  • Search online for each of the apps websites and post the References.
  • Supply the References to the licenses in APA Format
  • What Software Licenses apply to each of your applications?  
    • Retail Software
    • Custom Software
    • Shareware
    • Freeware
    • Open-Source
    • Public Domain

In: Computer Science

Write Python code that asks the user for a password from the console and continues asking...

Write Python code that asks the user for a password from the console and continues asking for a password until the user enters a password that has greater than 10 characters.

(language python)

In: Computer Science

1. List ALL the different type of network connections involved in the operations for each of...

1. List ALL the different type of network connections involved in the operations for each of the scenarios below. Provide an illustration for each of the scenarios.

Scenarios a. You have just bought a new mobile phone from an online shop. You have decided to take a few snapshots of your best friend and send them to the email account of a mutual friend across the country. b. You are driving around in an unfamiliar city and have just gotten lost. By using your mobile phone’s GPS system, you submit a request for driving directions from a nearby intersection to your destination.

2. Broadcast networks refer to networks such as LANs connected by a technology such as Ethernet. Broadcast networks, by nature, are multiaccess where all routers in a broadcast network can receive a single transmitted packet. Discuss the requirements or deficiencies of a network layer (OSI layer 3 and TCP/IP layer 2) in a broadcast network.

In: Computer Science

Variable trials refers to a list where each list item is another list of 3 integers...

Variable trials refers to a list where each list item is another list of 3 integers between 0 and 9. Imagine each list of 3 integers is a combination of numbers of a lock. Further suppose the variable code refers to a list of three integers that is the correct combination of the lock.

Write a program which, assuming trials and code are already defined, prints out a character for each digit of each trial. Print Y if the digit in the trail matches the digit at the same position in the code. Print # if the digit in the trial does not match the digit at the same position in the code but appears elsewhere in the code. Print N if the digit of the trial does not match the digit in the code and the digit in the trial appears nowhere in the code. Print a newline after the characters after three numbers (for each trial).

Example, if trails = [[2,3,4], [5,5,5], [5,2,3]], and code = [2,3,5], the program output should be:

Y Y N

# # Y

# # #

Hint: the in and not in operators can be used to test whether an item appears in a list.

(language python.)

In: Computer Science