Write a C Unix shell script called showperm that accepts two command line parameters. The first parameter should be an option flag, either r, w or x. The second parameter should be a file name. The script should indicate if the specified file access mode is turned on for the specified file, but it should display an error message if the file is not found. For example, if the user enters: showperm r thisfile the script should display “readable” or “not readable” depending on the current status of thisfile.
In: Computer Science
You are assigned to implement the following baggage-check-in system at the airport.
The system keeps track of data for the following information: passenger, bags, and tickets.
The program must maintain passenger details like name, address, phone number, and the number of bags. Each passenger can have multiple bags and each bag has length, width, height, and weight. The passenger also has a ticket. The tickets are of two types, either a first-class ticket or an economy-ticket. The maximum weight allowed for a first-class ticket is 40 Kilos and the maximum weight allowed for an economy-ticket is 30 Kilos. The program must display all the details of the passenger, ticket, and number of bags and allowed weight. If the weight exceeds that of the respective ticket class, then the program will give appropriate message to indicate that the passenger cannot travel. Your program must throw an exception to indicate the failure.
Requirements
In: Computer Science
Use C++
Black Jack
Create a program that uses methods and allows the user to play the game of blackjack against the computer dealer. Rules of Blackjack to remember include:
1. You need one 52 card deck of cards with cards from 2-Ace (4 cards of each number).
2. Jacks, Queens and Kings count as 10 points.
3. An Ace can be used as either 1 or 11 depending on what the user decides during the hand.
4. Draw randomly two cards for the "dealer" and display one of them while keeping the other hidden. Also, randomly draw two cards for the player and display them in view.
5. Allow the user to hit (randomly draw a card) as many times as they wish. If the player "busts" or gets over 21, the dealer automatically wins the players wager.
6. After the user "stands" or is satisfied with his total, the dealer must take a card if his total is 16 or below, and cannot take a card if his total is 17 or above.
7. If the dealer "busts" or goes over 21, the player wins back his wager plus his wager again. (Example - if a player bets $3 he gets back his original $3 plus an additional $3).
8. If neither the dealer or the player "busts" or goes over 21, then the highest total wins. Ties go to the dealer.
9. Note - the player should start with $20 in the bank and cannot wager more than he currently has in the bank.
10. Note - before each round the user can bet in whole dollars how much to wager or how much of the total in the bank to risk.
11. Allow the user to quit at any time. Of course, the user must quit if he/she runs out of money.
12. Remember, somehow ensure that the same card (example - 6 of spades) cannot be drawn twice in a single hand.
In: Computer Science
A parent may terminate the execution of one of its children. What are the reasons?
In: Computer Science
topic:- Fundamentals of Databases
*********** no hand writing*********
If there is photo but photo don’t do fax ?
*the answer must be unique not copied "plagiarized "
question One
Consider the following two tables:
Table – EmployeeInformations
EmpId Name ManagerId DateOfJoining
121 Ali 321 01/31/2014
321 Raed 986 01/30/2015
421 Khaled 876 27/11/2016
Table – EmployeeSalary
EmpId Project Salary
121 P1 8000
321 P2 1000
421 P1 12000
Question
Explain the role of SQL authorization mechanisms that allow to differentiate among the users of the database as far as the type of access they are permitted on various data values in the database?
In: Computer Science
2b.With an internet shopping world example,explain the online shopping ai agent with html form code.(50marks)
Need own answer and no internet answers r else i il downvote nd report to chegg.Even a single is wrong i il downvote.its 50marks question so no short answer minimum 10page answer required and own answer r else i il downvote.
Note:Minimum 10page answer and no plagarism r else i il downvote and report to chegg.Minimum 10 to 15page answer required r else dnt attempt.strictly no internet answer n no plagarism.
its 50marks question so i il stricly review nd report
need own answer for 50marks.
In: Computer Science
FASTQ to FASTA converter: Implement a FASTQ to FASTA file format converter in python (the input is a FASTQ file and the output is a FASTA file)
In: Computer Science
Write a Python program that prints 20 “random” license plate numbers, each one consisting of three randomly-chosen digits followed by three randomly chosen upper-case letters. The first digit cannot be zero. Sample output might look like: 382 HGK 819 YEU
In: Computer Science
APPLICATIONS (GOOGLE CHROME, MICROSOFT EDGE BROWSER AND THUNDERBIRD MAIL APPLICATION) How does each of them address patch management? Visit their Web sites to determine facilities they have to alert users to new vulnerabilities. Then look at three competing products (for example, if you are examining Microsoft Office, then look at OpenOffice) and evaluate their patch management system. What did you discover? Are the patch management systems adequate? During your research, be sure to answer the following questions
In: Computer Science
Create a program in Visual studio c++ Frank wants to take his wife, son, and daughter on a vacation this next summer. Create a program named "Your last name_Vacation" This program will prompt Frank to choose a number between 1 and 6. Use a switch…case to determine which number he chose. Use a Do…while loop to return to the prompt if the number is <1 and >6. 1 - Hawaii – 7 days / 6 nights 2 - New York – 3 days / 2 nights 3 - London – 7 days / 6 nights 4 - Bahamas – 7 days / 6 nights 5 - Miami – 3 days / 2 nights 6 - Los Angeles – 3 days / 2 nights The default will be; Stay Home – 7 days / 6 nights Use a Do…while loop to return to the prompt if the number is <1 and >6. Create a message that tells Frank about his vacation he chose. Use a for loop to create a list when Frank enters his first name, last name, and age, then enters the same for his wife, son, and daughter. Ex. Frank Last Age Wife “ “ Son “ “ Daughter “ “ Frank will input the departure date of his vacation. The final output should be in the following format; Congratulations! You and your family are going to “location” Frank Last Age Wife “ “ Son “ “ Daughter “ “ Your departure date is “date”.
In: Computer Science
Convert into pseudo-code for below code
===============================================
class Main
{
public static void main(String args[])
{
Scanner s=new
Scanner(System.in);
ScoresSingleLL score=new
ScoresSingleLL();
while(true)
// take continuous inputs from user till he
enters -1
{
System.out.println("1--->Enter a number\n-1--->exit");
System.out.print("Enter your choice:");
int
choice=s.nextInt();
if(choice!=-1)
{
System.out.print("Enter the score:");
int number=s.nextInt();
System.out.print("Enter the name:");
String name=s.next();
GameEntry entry=new
GameEntry(name,number);
if(number!=-1)
{
if(score.getNumberOfEntries()==10)
// if linkedlist has more than 10 nodes, remove
min score and add new score
{
int
minValue=score.getMinimumValue(); // function to get
minValue
if(minValue<number)
// if min score is greater than given score,
then dont add new node
{
int
minValueIndex=score.getMinimumValueIndex(); // function
to get minValueIndex
score.remove(minValueIndex);
// remove minValueIndex
node
score.add(entry);
// add the new node
}
}
else
{
score.add(entry);
// if
linked list has less than 10 nodes, add the current node
}
}
score.printScore();
// method to print entries in linked lists
score.printHighestToLowest();
}
else
{
break;
}
}
}
}
class ScoresSingleLL
{
SingleLinkedList head=null;
int noOfEntries=0;
public void add(GameEntry e)
{
SingleLinkedList tempNode=new
SingleLinkedList(e);
if(head==null)
// if list is empty add new
node as head
{
head=tempNode;
}
else
{
SingleLinkedList
node=head;
while(node.next!=null) // else add
new node at tail
{
node=node.next;
}
node.next=tempNode;
}
noOfEntries++;
}
public GameEntry remove(int minValueIndex)
{
SingleLinkedList node=head;
if(minValueIndex==0)
// if value to be removed is head, remove
head
{
head=head.next;
}
else
{
SingleLinkedList
prevNode=head; // else remove index
'i' element
node=head.next;
int
index=1;
while(index!=minValueIndex)
{
index++;
prevNode=node;
node=node.next;
}
prevNode.next=node.next;
}
noOfEntries--;
return node.node;
}
public int getMinimumValueIndex()
{
SingleLinkedList
node=head;
int
minValue=Integer.MAX_VALUE;
int index=0,i=0;
while(node!=null)
{
if(node.node.score<minValue)
{
minValue=node.node.score;
index=i;
}
node=node.next;
i++;
}
return index;
}
public int getMinimumValue()
{
SingleLinkedList
node=head;
int
minValue=Integer.MAX_VALUE;
while(node!=null)
{
if(node.node.score<minValue)
{
minValue=node.node.score;
}
node=node.next;
}
return minValue;
}
public void printHighestToLowest()
{
int [] arr=new
int[noOfEntries];
int i=0;
for(SingleLinkedList
node=head;node!=null;node=node.next)
{
arr[i++]=node.node.getScore();
}
Arrays.sort(arr);
System.out.println(Arrays.toString(arr));
}
public int getNumberOfEntries()
{
return noOfEntries;
}
public void printScore()
{
SingleLinkedList
node=head;
while(node!=null)
{
System.out.println(node.node.name+" "+node.node.score);
node=node.next;
}
}
}
class SingleLinkedList
{
GameEntry node;
SingleLinkedList next;
SingleLinkedList(GameEntry node)
{
this.node=node;
}
}
===============================================
In: Computer Science
C++ programming
You are to implement a MyString class which is our own limited implementation of the std:: string
Header file and test (main) file are given in below, code for mystring.cpp.
Here is header file
mystring.h
/* MyString class */
#ifndef MyString_H
#define MyString_H
#include <iostream>
using namespace std;
class MyString {
private:
char* str;
int len;
public:
MyString();
MyString(const char* s);
MyString(MyString& s);
~MyString();
friend ostream& operator <<(ostream& os, MyString& s); // Prints string
MyString& operator=(MyString& s); //Copy assignment
MyString& operator+(MyString& s); // Creates a new string by concantenating input string
};
#endif
Here is main file, the test file
testMyString.cpp
/* Test for MyString class */
#include <iostream>
#include "mystring.h"
using namespace std;
int main()
{
char greeting[] = "Hello World!";
MyString str1(greeting); // Tests constructor
cout << str1 << endl; // Tests << operator. Should print Hello World!
char bye[] = "Goodbye World!";
MyString str2(bye);
cout << str2 << endl; // Should print Goodbye World!
MyString str3{str2}; // Tests copy constructor
cout << str3 << endl; // Should print Hello World!
str3 = str1; // Tests copy assignment operator
cout << str3 << endl; // Should print Goodbye World!
str3 = str1 + str2; // Tests + operator
cout << str3 << endl; // Should print Hello World!Goodbye World!
return 0;
}
In: Computer Science
STRICT DOWNVOTE IF NOT DONE FULLY, WILL REPORT ALSO IF COPY PASTED OR MODIFIED ANSWER Develop a class, using templates, to provide functionality for a set of recursive functions. The functions specified as recursive must be written recursively (not iterativly). The UML class specifications are provided below. A main will be provided. Additionally, a make file will need to be developed and submitted. ● Recursion Set Class The recursion set template class will implement the template functions. recursionSet -length: int -*mySet: myType -MAX_VALUE = 500000 static const: int -LIMIT = 1000 static const: int +recursionSet() +recursionSet(const recursionSet&) +~recursionSet() +getSetLength() const: int +generateElements(int): void + getElement(int) const: myType +setElement(int, myType): void +readValue(const string) const: int +printSet() const: void +operator == (const recusrionSet&): bool +tak(myType, myType, myType) const: myType +printSeptenary(myType) const: void +squareRoot(myType, myType) const: myType -recSqRoot(myType, myType, myType) const: myType +recursiveSum() const: myType -rSum(int) const: myType +checkParentheses(string) const: bool -recChkPar(string, int, int) const: bool +recursiveInsertionSort(): void -recInsSort(int, int): void -insertInOrder(myType, int, int): voidYou may add additional private functions if needed (but, not for the recursive functions). Note, points will be deducted for especially poor style or inefficient coding. Function Descriptions • The recursionSet() constructor should set the length to 0 and mySet pointer to NULL. • The recusrsionSet(const recursionBucket&) copy constructor should create a new, deep copy from the passed object. • The ~recursionSet() destructor should delete the myType array, set the pointer to NULL, and set the size to 0. • The setElement(int, myValue) function should set an element in the class array at the given index location (over-writing any previous value). The function must include bounds checking. If an illegal index is provided, a error message should be displayed. • The getElement(int) should get and return an element from the passed index. This must include bounds checking. If an illegal index is provided, a error message should be displayed and a 0 returned. • The getSetLength() functions should return the current class array length. • The printSet(int) function should print the formatted class array with the passed number of values per line. Use the following output statement: cout << setw(5) << mySet[i] << " • "; Refer to the sample executions for formatting example. The readValue(string) function should prompt with the passed string and read a number from the user. The function should ensure that the value is 3 1 and £ MAX_VALUE. The function should handle invalid input (via a try/catch block). If an error occurs (out of range or invalid input) an appropriate message should be displayed and the user re- prompted. Example error messages include: cout << "readSetLenth: Sorry, too many " << "errors." << endl; cout << "readSetLenth: Error, value " << cnt << " not between 1 and " << numMax << "." << endl; • Note, three errors is acceptable, but a fourth error should end the function and return 0. The generateList(int) function should dynamically create the array and use the following casting for rand() to fill the array with random values. mySet[i] = static_cast(rand()%LIMIT); • • • The printSeptenary(myType) function should print the passed numeric argument in Septenary (base-7) format. Note, function must be written recursively. The recursiveSum() function will perform a recursive summation of the values in class data set and return the final sum. The function will call the private rSum(int) function (which is recursive). The rSum(int) function accepts the length of the data set and performs a recursive summation. The recursive summation is performed as follows: rSum ( position )= • { array[ 0] array[ position ] + rSum ( position−1) if position = 0 if position > 0 The tak(myType) function should recursively compute the Tak 1 function. The Tak function is defined as follows: tak ( x , y , z) = { z tak ( tak ( x−1, y , z) , tak ( y−1, z , x) , tak ( z −1, x , y ) ) 1 For more information, refer to: http://en.wikipedia.org/wiki/Tak_(function) if y≥ x if y < x• • The squareRoot(myType, myType) function will perform a recursive estimation of the square root of the passed value (first parameter) to the passed tolerance (second parameter). The function will call the private sqRoot(myType,myType,myType) function (which is recursive). The private recSqRoot(myType,myType,myType) function recursively determines an estimated square root. Assuming initially that a = x, the square root estimate can be determined as follows: recSqRoot ( x , a , epsilon) = • • • • • { 2 if ∣ a − x ∣ ≤ epsilon a 2 (a + x) sqRoot x , , epsilon 2 a ( ) if ∣ a 2 − x ∣ > epsilon The recursiveInsertionSort() function should sort the data set array using a recursive insertion sort. The recursiveInsertionSort() function should verify the length is valid and, if so, call the recInsSort() function to perform the recursive sorting (with the first element at 0 and the last element at length-1). The recInsSort(int, int) function should implement the recursive insertion sort. The arguments are the index of the first element and the index of the last element. If the first index is less than that last index, the recursive insertion sort algorithm is follows: ▪ Recursively sort all but the last element (i.e., last-1) ▪ Insert the last element in sorted order from first through last positions To support the insertion of the last element, the insertInOrder() function should be used. The insertInOrder(myType, int, int) function should recursively insert the passed element into the correction position. The arguments are the element, the starting index and the ending index (in that order). The function has 3 operations: ▪ If the element is greater than or equal to the last element in the sorted list (i.e., from first to last). If so, insert the element at the end of the sorted (i.e, mySet[last+1] = element). ▪ If the first is less than the last, insert the last element (i.e., mySet[last]) at the end of the sorted (i.e., mySet[last+1] = mySet[last]) and continue the insertion by recursively calling the insertInOrder() function with the element, first, and last-1 values. ▪ Otherwise, insert the last element (i.e., mySet[last]) at the end of the sorted (i.e., mySet[last+1] = mySet[last]) and set the last value (i.e., mySet[last]) to the passed element. The checkParentheses(string) function should determine if the parentheses in a passed string are correctly balanced. The function should call the private recChkPar(string, int, int) function (which is recursive) The recChkPar(string, int, int) function should determine if the parentheses in a string are correctly balanced. The arguments are the string, an index (initially 0), and a parenthesis level count (initially 0). The index is used to track the current character in the string. The general approach should be as follows: ◦ Identify base case or cases. ◦ Check the current character (i.e., index) for the following use cases: ▪ if str[index] == '(' → what to do then ▪ if str[index] == ')' → what to do then ▪ if str[index] == any other character → what to do then Note, for each case, increment the index and call function recursively.
In: Computer Science
Please read the whole program (all the way to the bottom), Thanks in advance!
Develop car rental application may use to produce a receipt. A receipt will be formatted as follows:
E Z – R I
D E R
Rental Receipt
Customer : John
Jones
Driver License : PA 12343
Telephone : 724-555-8345
Credit Card : VISA 12345678012
Vehicle : Mercedes
350E
Tag # : PA
342399
Rent Class : Luxury Sedan
Daily Rate : $ 95.00
Weekly Rate : $ 545.00
Date/Time Out : 01/10/2017 at 10:45
Date/Time In : 01/20/2017 at 11:44
Rental Charge : $ 830.00
Airport Tax : $ 150.00
Sales Tax : $ 49.80
Total : $
1029.80
For this application create four main classes for customer, rental
class, vehicle, and rental agreement. The customer class should
have six pieces of information (i.e. instance variables) including
customer name (as a String), driver’s license state (as a String),
driver’s license number (as an int), telephone number (as a
String), credit card type (as a String), and credit card number (as
a long). A rental class represents the rental terms for a class of
vehicle. For example Compact, Mid-Size, Full Size, Sport etc. are
classifications of cars with each time having different rental
terms. A rental class should have three pieces of information: a
rental class name (as a String), a daily rate (as a double) and a
weekly rate (as a double). A vehicle should have four pieces of
information: a make/model (as a String), state issuing a tag (as a
String), a tag number (as a String) and a rental class (as a rental
class). Lastly a rental agreement is the agreement of a customer to
rental a given vehicle together with the rental terms, date/time
out and date/time in. Thus a rental agreement has 4 pieces of
information: the customer, the vehicle, date/time out (as a
LocalDateTime) and date/time in.
For your customer class, provide a constructor accepting values for all instance variables. Provide getter methods for all instance variables except account number, but setter methods for only the telephone, credit card type and credit card number variables.
For rental class class, provide a constructor accepting values for all instance variable. Provide getter methods for all instance variables. Likewise for the vehicle class.
For your rental agreement class provide a constructor accepting values for all instance variables except date/time in as it is intended that this field will be given a value only when the customer returns the vehicle. Provide only getter methods for all instance variables. Provide a setter method for only the date/time in variable.
To represent a date/time use Java’s LocalDateTime class. For this class, however, do not use new to create instances. Instead use the of method:
LocalDateTime dateTimeOut = LocalDateTime.of(2017,1,10, 8, 45);
The above example creates a LocalDateTime for 1/10/2017 at 8:45.
In the rental agreement provide getRentalCharge(), getAirportTax(), getSalesTax() and getTotal() methods. The getRentalCharge() is to return the number of days rented times the daily rental rate. The getAirportTax() is to return the number of days rented times $ 15.00. The getTax() is to return the rental change times 6%. The getTotal() is to return the sum of rental charge, airport tax, and tax.
In addition to the special get methods, provide a print receipt method that will print the receipt according to the above format.
A day is a 24 hours period. However, there is a one hour grace in returning a car. That is if a car is returned after 24 hours and 59 minutes, then only one day is used in the computations. To compute the number of days between dateTimeOut and dateTimeIn, use the following code:
int noDays = Duration.between(dateTimeOut,dateTimeIn).plusMinutes(23 * 60);
BONUS 5 points: have the computation of rental charge use weekly
rate to the best benefit of the customer. The data in the example
is using the weekly rate. That is one week charge plus three days
at the daily rate. The weekly rate should be used where
it benefits the customer even in cases where it is better than the
daily rate. For example if in the example the vehicle was rented 6
days and 1 week rental charges should be used.
In addition, develop another class to test your classes by printing
three separate, and different, recepts. This class will have a main
method. In the main method, create instances of your
classes in order to print the three separate receipts. Thus, you
will hard code inside the main the values to be used when
instantiating your classes. With the exception of the fixed values
given in the computations above (for example .06 for sales tax
rate), do not hard code any other data within your classes. For
each receipt instance, call the print method to print the receipt.
Make sure to call setDateTimeIn appropriately after creating an
instance of a rental receipt and before printing.
NOTE: You do not need, and therefore should not, code any routines to input the values from the user or from files. Your test class is sufficient to demonstrate that your classes are working correctly. If you do the bonus, make sure to have data that will test the logic.
Make sure the instance variables are private. Provide javadoc for each class and methods. Abide by good programming practices.
In: Computer Science
In Linux Professional:
PE15 (CH)
1 – why is the max RAM for a 32-bit OS 4 GiB?
2 – virtual memory is called what on Linux? Where is it
located?
3 – how many CPU(s) does the VM have?
4 – list all PCI devices; how many of them are there?
5 – Without looking these up, try to spell-out these
acronyms:
BIOS, UEFI, SCSI, IDE, SATA, IRQ, DMA, PCI
In: Computer Science