COSC2506 Practical Test 1
.docx
keyboard_arrow_up
School
Royal Melbourne Institute of Technology *
*We aren’t endorsed by this school
Course
2384
Subject
Computer Science
Date
Apr 27, 2024
Type
docx
Pages
5
Uploaded by MagistrateGrouse3661 on coursehero.com
Answer Sheet – COSC2506 Practical Test 1 Student Name: Date: 10/08/2023
Task 1 (Q1-Q7 – 7 points)
Copy your answers/outputs
from the terminal here. Q1
student@ubuntu:~$ mkdir s3333333
Q2
student@ubuntu:~$ cd s3333333
student@ubuntu:~/s3333333$ mkdir trial
student@ubuntu:~/s3333333$ mkdir test
Q3
student@ubuntu:~/s3333333$ cd test
student@ubuntu:~/s3333333/test$ touch myfile
student@ubuntu:~/s3333333/test$ touch yourfile
Q4
student@ubuntu:~/s3333333$ cd
student@ubuntu:~$ cd /home/student/s3333333/test
student@ubuntu:~/s3333333/test$
Q5
student@ubuntu:~/s3333333$ cd /home/student/s3333333/test
student@ubuntu:~/s3333333/test$ rm myfile
student@ubuntu:~/s3333333/test$ ls
yourfile
Q6
student@ubuntu:~/s3333333/test$ cd /home/student/s3333333
student@ubuntu:~/s3333333$ rmdir test
student@ubuntu:~/s3333333$ ls
trial
Q7
student@ubuntu:~/s3333333$ echo "Date: 'date+%d/%m/%y'. Time: 'date+%I:%M'"
Date: 'date+%d/%m/%y'. Time: 'date+%I:%M'
Task 2 (Q8-Q9 – 2 points)
Copy your answers/outputs
from the terminal here. student@ubuntu:~/s3333333$ touch file_again
student@ubuntu:~/s3333333$ mkdir dir_again
student@ubuntu:~/s3333333$
Q8
student@ubuntu:~/s3333333$ chmod u=rwx,g=rx,o=r file_again
student@ubuntu:~/s3333333$
Q9
student@ubuntu:~/s3333333$ chmod 754 dir_again
student@ubuntu:~/s3333333$
Task 3 (Q10-Q11 – 2 points)
Copy your answers/outputs
from the terminal here. Q10
student@ubuntu:~/s3333333$ echo "Today is $(date '+%A'). It is $(date '+%j')th day of the year."
Today is Thursday. It is 222th day of the year.
Q11
student@ubuntu:~/s3333333$ sed -n '35p' /etc/passwd
usbmux:x:113:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
Task 4 (Q12-Q14 – 6 points)
Copy your answers/outputs
from the terminal here. Q12
student@ubuntu:~$ ls -a > filesnumber
student@ubuntu:~$ cat filesnumber
.
..
.bash_history
.bash_logout
.bashrc
.cache
.config
.gnupg
.local
.profile
.ssh
.sudo_as_admin_successful
.vboxclient-clipboard.pid
.vboxclient-display-svga-x11.pid
.vboxclient-draganddrop.pid
.vboxclient-seamless.pid
.viminfo
Desktop
Documents
Downloads
Music
Pictures
Public
Templates
Videos
filesnumber
s3333333
task1
task1.new
task1_difference
tut3
two
Q13
student@ubuntu:~$ ls -1A | sort | tr 'a-z' 'A-Z'
.BASH_HISTORY
.BASH_LOGOUT
.BASHRC
.CACHE
.CONFIG
.GNUPG
.LOCAL
.PROFILE
.SSH
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
It is Question: Creating a program for a market. The system can send a family card to a consumer and accept a discount of 0% (no discount), 5%, or 10% based on the following rules:
The default discount choice is "no discount."
There is no discount for unregistered users. A family card is not supplied to an unregistered user.
If a registered user has spent more than $1000 on past food purchases and has less than 19 shopping sessions, they will receive a 5% discount.
If a registered user spent more than $1000 in prior grocery shopping sessions and had at least 20 grocery shopping sessions, they would receive a 10% discount.
Only registered users who spend over $1000 or have at least 20 shopping sessions receive a family card.
My program works just fine. It meets the conditions in the question. But my problem is I can't run Junit tests no matter how hard I try. According to my program, can you write Junit test and post the Junit test codes?
arrow_forward
Transcribed Image Text
Joshua, a systems administrator, is configuring new Windows 10 laptops. He is creating new local users on each laptop. He realizes that two users have the same name, Miguel. He uses the name Miguel for one user. Which of the following is a valid user name that he can create for the second user? a) Miguel? b) Mig c) Miguel d) Miguel2 e) All the above will work!
arrow_forward
I need a help with my python activity. This requires 2 clients and 1 server. This is a system to support an online math contest.
Rule:
There are two participants answering at the same time.
The host is responsible in starting up the server, after that they wait for the clients. When the two clients are connected, they must send the message: READY to the server. When the server receives the two READY from the clients, the contest starts.
The server will display 3 questions one after another which can be answered in 30 secs each.
11+10 = 21
10+22 = 32
10+10 = 20
The participant with most correct answers wins.
At the end of the program, the server must show the results.
ex: Client1 WINS! 2/3
Client2: 1/3
arrow_forward
Computer Science
Create a session variable called SProot and assign the generated positive root valueto it in Oroots.php. Display this session variable in PosRoot,php page.
arrow_forward
Computer Science
A tool is attached to link 3 of the manipulator. This tool is described by TTW, the tool frame relative to the wrist frame. Also, a user has described his work area, the station frame relative to the base of the robot, as TSB. Write the subroutine Procedure SOLVE(VAR trels: frame; VAR current, near, far: vec3; VAR sol: boolean); where “trels” is the {T} frame specified relative to the {S} frame. Other parameters are exactly as in the INVKIN subroutine. The definitions of {T} and {S} should be globally defined variables or constants. SOLVE should use calls to TMULT, TINVERT, and INVKIN
arrow_forward
The task should be done in a group of max 3
In the program explained during the lab
the client sends only 1 message to server ‘hello from tcp client’
server responds with the uppercase message.
Update the program / make a simple chat program so that
Client can send/receive multiple messages to server.
A special exit message is used to disconnect ‘Exit’.
Each time client sends a message, server responds with a confirmation of receiving it and its length
(use the screenshots in the presentation as a reference)
arrow_forward
Computer Science
course Operating system fundamentals:
help i need it ASAP
Process Q sends a message to another process in the same system. It is not necessary to know if the message is delivered or not and process Q has no information about the receiver processes. Which message passing method (Indirect/Direct, Synchronous/Asynchronous, Blocking/Non-blocking) should be used? Explain your answers in detail.
arrow_forward
Instructions:
Use online editor for doing shell script
Use JSLinux online tool to do practicals (Website address : https://bellard.org/jslinux)
===========================================================Write a shell script that reads the price for 6 mobile phones and counts the price of mobile phones
whose price is more than 300 OMR.
Note :
· Use loop and conditional statements.
· Display the appropriate output.
arrow_forward
Wireless error correction works best. This statement: yes or no? Provide instances.
arrow_forward
Complete the Python program below to download and display the content below.
import requests# response = requests.get("https://en.wikipedia.org/robots.txt")response = requests.get("https://en.wikipedia.org/wiki/MediaWiki:Robots.txt")test = #TO DO -- Complete the Codeprint("robots.txt for http://www.wikipedia.org/")
arrow_forward
1. You work for an online song distribution company. 2. Code a modular program that will accept an order of playlists that allows users to pick the platform and the number of songs in the playlist. 3. Your program will calculate the total of the order of playlists. 4. Do not accept any values for playlists other than the possible menu options. Use the table below to calculate the individual playlist costs. Playlist Platform Playlist length Cost Per Playlist Jim Bob’s Pretty Good Music Three Songs $2.23 Five Songs $3.99 Ten Songs $6.69 Suzy Bob’s Better Music Three Songs $3.52 Five Songs $5.05 Ten Songs $8.77 In In addition to main, the program must contain the following functions: getPlaylists() o Ask the user how many playlists will be ordered. Validate the input of the number of playlists so that the user must enter at least one playlist before proceeding with the program. Function must return the validated number of playlists. getPlatform() o Use a menu to prompt the user for…
arrow_forward
Hi please assist urgentPlease verify each linethanks
arrow_forward
Describe the steps that may be taken to make the SimpleInterestCalculator available as a RESTful service.
arrow_forward
can you see if this code works from your end . if it does can you share the compiler name and also share screenshots of the code output
import requests
# Take user input for city and statecity = input("Enter city name: ")state = input("Enter state name: ")
# Set API endpoint and parametersurl = "http://api.openweathermap.org/data/2.5/weather"params = { "q": f"{city},{state}", "appid": "bdc131976a43a5df7074f0aef35fc088", "units": "imperial"}
# Make GET request to APIresponse = requests.get(url, params=params)
# Check if request was successfulif response.status_code == 200: # Parse JSON data from response data = response.json()
# Extract relevant information from data location = data['name'] temp = data['main']['temp'] humidity = data['main']['humidity'] description = data['weather'][0]['description']
# Print weather information print(f"Current weather in {location}:") print(f"Temperature: {temp}°F") print(f"Humidity: {humidity}%")…
arrow_forward
Implement the one-time pad encryption scheme in Microsoft Excel. Your worksheet should look as follows: For Encryption: - Have the message occupy adjacent cells in one row, with one bit of the message in each cell. Align the key (the one-time pad) with the message in the next row. Note that the key should be of the same length as the message. In the next row, enter a formula that computes the ciphertext. Decryption is similar: - Have the ciphertext occupy adjacent cells in one row, with one bit of the ciphertext in each cell. Align the key (the one-time pad) with the ciphertxt in the next row. Note that the key should be of the same length as the ciphertext. In the next row, enter a formula that computes the plaintext (message). .
arrow_forward
There are multiple publicly accessible web and application servers in the CSM Tech group. All of your publicly available resources are served through DNS servers. Your public DNS servers, however, are being used to perform recursive lookups for clients that are not part of your business. Recursive requests from internal clients should only be handled by your public DNS servers; iterative inquiries from external sources should be handled by the servers. Are there any more ideas that you'd want to share? Is there anything else I need to know about the solution?
arrow_forward
Review the following program that extracts the email server domain name.
>>> data = 'From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008 ' >>> atpos = data.find('@')
>>> print(atpos)
21
>>> sppos = data.find(' ',atpos)
>>> print(sppos)
31 >>> host = data[atpos+1 : sppos]
>>> print(host)
1. Adapt the program to extract the user name (stephen.marquard) and Copy+Paste the code in the answer2. Run the adapted program and include a full window screenshot with system time and date in the answer.
arrow_forward
Design a system for a restaurant in which users can order multiple food items from the following menu:• Press 1 to buy pizza• Press 2 to buy rice• Press 3 to buy steak• Press 4 to buy spaghetti• Press 5 to buy teaThe user enters the balance on their credit card. User can buy multiple products if he/she has the desired balance. If the user is a member of the restaurant, then the system should give a 10% discount. In the end, add 16% GST on total bills and deduct money from a credit card. You are required to follow the following price chart of the products:• Pizza= 1500• Rice= 350• Steak = 1100• Spaghetti=500• Tea=30
arrow_forward
Which of the following statements is true of Verilog?
a.
Verilog is an HDL that orginated in 1985 at a company called Gateway Design Automation
b.
Verilog is an HDL that was first published in 1987 as an IEEE standard
c.
Verilog was developed at the behest of the U.S. Dept. of Defense
d.
Verilog's syntax is borrowed largely from Ada, an earlier DoD language
arrow_forward
1) Create a new user account. The username should be your first name. The primary group of this user account should be your partner's first name.
2) Create another user account. The name must, this time, be randomly generated. This account should be part of the following groups: users, sys & root.
3) Explain how to run the command 'ping 8.8.8.8' under the user created in Step 1.
4) Write a pipeline to the number of accounts associated with the group 'users'.
5) Write a pipeline to only allow the user created in Step 1 to execute the command 'top'.
arrow_forward
Computer science
Use C language to solve the question. The initial server and client .c code is given write code using these .c client and server files.
Q1:
Design a client-server model for two-way communication. Both the client and server should beable to send and receive messages.Upon the establishment of successful connection, the server should send a message, “Hi, youhave connected to the server!”.[The client should then send a string to the server. The server should reverse the string andsend it back to the client. The client should then display the received string.] This job will bedone in a loop of 5 times.
--------------------------------------------
server.c
#include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> int main() { char server_message[256] = "Hi, Yes you have reached the server!"; char buf[200]; // create the server socket int server_socket; server_socket = socket(AF_INET,…
arrow_forward
Vll upvote , handwritten acceptable ...
arrow_forward
Extract the timestamps present in this log message and find the difference between two timestamps:
START 2020-12-30 02:52:39.345 This is a sample log message with two timestamp occurances 2020-12-30 10:33:20.450 END Java
arrow_forward
Write client and server code to do the following -
1. Client sends the message "University of Florida" 100 times to the server and "1/31/2022" 100 times
2. The server prints "University of Florida" and "1/31/2022" only once
Upload c codes (simple text file using notepad) and a screenshot of the terminal showing that it's working!
Upload c codes (simple text file using notepad) and a screenshot of the terminal showing that it's working!
arrow_forward
6 Cell Phone PackagesCell Solutions, a cell phone provider, sells the following packages:300 minutes per month: $45.00 per month800 minutes per month: $65.00 per month1500 minutes per month: $99.00 per monthThe provider sells the following phones (a 6 percent sales tax applies to the sale of a phone):Model 100: $29.95Model 110: $49.95Model 200: $99.95Customers may also select the following options:Voice mail: $5.00 per monthText messaging: $10.00 per monthWrite an application that displays a menu system. The menu system should allow the userto select one package, one phone, and any of the options desired. As the user selects itemsfrom the menu, the application should show the prices of the items selected.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- It is Question: Creating a program for a market. The system can send a family card to a consumer and accept a discount of 0% (no discount), 5%, or 10% based on the following rules: The default discount choice is "no discount." There is no discount for unregistered users. A family card is not supplied to an unregistered user. If a registered user has spent more than $1000 on past food purchases and has less than 19 shopping sessions, they will receive a 5% discount. If a registered user spent more than $1000 in prior grocery shopping sessions and had at least 20 grocery shopping sessions, they would receive a 10% discount. Only registered users who spend over $1000 or have at least 20 shopping sessions receive a family card. My program works just fine. It meets the conditions in the question. But my problem is I can't run Junit tests no matter how hard I try. According to my program, can you write Junit test and post the Junit test codes?arrow_forwardTranscribed Image Text Joshua, a systems administrator, is configuring new Windows 10 laptops. He is creating new local users on each laptop. He realizes that two users have the same name, Miguel. He uses the name Miguel for one user. Which of the following is a valid user name that he can create for the second user? a) Miguel? b) Mig c) Miguel d) Miguel2 e) All the above will work!arrow_forwardI need a help with my python activity. This requires 2 clients and 1 server. This is a system to support an online math contest. Rule: There are two participants answering at the same time. The host is responsible in starting up the server, after that they wait for the clients. When the two clients are connected, they must send the message: READY to the server. When the server receives the two READY from the clients, the contest starts. The server will display 3 questions one after another which can be answered in 30 secs each. 11+10 = 21 10+22 = 32 10+10 = 20 The participant with most correct answers wins. At the end of the program, the server must show the results. ex: Client1 WINS! 2/3 Client2: 1/3arrow_forward
- Computer Science Create a session variable called SProot and assign the generated positive root valueto it in Oroots.php. Display this session variable in PosRoot,php page.arrow_forwardComputer Science A tool is attached to link 3 of the manipulator. This tool is described by TTW, the tool frame relative to the wrist frame. Also, a user has described his work area, the station frame relative to the base of the robot, as TSB. Write the subroutine Procedure SOLVE(VAR trels: frame; VAR current, near, far: vec3; VAR sol: boolean); where “trels” is the {T} frame specified relative to the {S} frame. Other parameters are exactly as in the INVKIN subroutine. The definitions of {T} and {S} should be globally defined variables or constants. SOLVE should use calls to TMULT, TINVERT, and INVKINarrow_forwardThe task should be done in a group of max 3 In the program explained during the lab the client sends only 1 message to server ‘hello from tcp client’ server responds with the uppercase message. Update the program / make a simple chat program so that Client can send/receive multiple messages to server. A special exit message is used to disconnect ‘Exit’. Each time client sends a message, server responds with a confirmation of receiving it and its length (use the screenshots in the presentation as a reference)arrow_forward
- Computer Science course Operating system fundamentals: help i need it ASAP Process Q sends a message to another process in the same system. It is not necessary to know if the message is delivered or not and process Q has no information about the receiver processes. Which message passing method (Indirect/Direct, Synchronous/Asynchronous, Blocking/Non-blocking) should be used? Explain your answers in detail.arrow_forwardInstructions: Use online editor for doing shell script Use JSLinux online tool to do practicals (Website address : https://bellard.org/jslinux) ===========================================================Write a shell script that reads the price for 6 mobile phones and counts the price of mobile phones whose price is more than 300 OMR. Note : · Use loop and conditional statements. · Display the appropriate output.arrow_forwardWireless error correction works best. This statement: yes or no? Provide instances.arrow_forward
- Complete the Python program below to download and display the content below. import requests# response = requests.get("https://en.wikipedia.org/robots.txt")response = requests.get("https://en.wikipedia.org/wiki/MediaWiki:Robots.txt")test = #TO DO -- Complete the Codeprint("robots.txt for http://www.wikipedia.org/")arrow_forward1. You work for an online song distribution company. 2. Code a modular program that will accept an order of playlists that allows users to pick the platform and the number of songs in the playlist. 3. Your program will calculate the total of the order of playlists. 4. Do not accept any values for playlists other than the possible menu options. Use the table below to calculate the individual playlist costs. Playlist Platform Playlist length Cost Per Playlist Jim Bob’s Pretty Good Music Three Songs $2.23 Five Songs $3.99 Ten Songs $6.69 Suzy Bob’s Better Music Three Songs $3.52 Five Songs $5.05 Ten Songs $8.77 In In addition to main, the program must contain the following functions: getPlaylists() o Ask the user how many playlists will be ordered. Validate the input of the number of playlists so that the user must enter at least one playlist before proceeding with the program. Function must return the validated number of playlists. getPlatform() o Use a menu to prompt the user for…arrow_forwardHi please assist urgentPlease verify each linethanksarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education