Using python:
In the directory rootdir some of the files contain randomly generated content while others are written by human authors. Determine how many of the files contained in the directory are written by human authors. Store your answer in the variable number_human_authored
In: Computer Science
AverageGrade.
Assume the professor gives five exams during the semester with
grades 0 through 100 and drops one of the exams with the lowest
grade. Write a program to find the average of the remaining four
grades. The program should use a class named Exams that has
An instance variable to hold a list of five grades,
A method that calculate and return average.
A string that return the “exams Average” for printing.
Your program output should prompt for an input for each grade. Use
any number between 0 and 100.
Your submission should include compiled output.
In Java Please
In: Computer Science
In C# Problem 1: Order matters! For this question, you’re going to write two recursive functions, both of which take in only a single string as a parameter; you will not receive credit if you pass in an integer as well. Note: you will need to understand substrings to get the correct solution. The first function should simply print out the string, but do so letter by letter – and recursively. The second function should print out the string in reverse; the code is almost identical, but the concept is different. Hint, note the title of the problem. Example Output: Hello world! !dlrow olleH
Problem 2: Summing up sums. For this question, you’ll understand the importance of using the results of smaller sets of work. You’re going to create a recursive function that takes in an array of random integers and returns a “sum of sums”. This is best explained through an example. If you have 5 elements in an array, the function should return the sum of elements 0-4, 1-4, 2-4, 3-4, and 4. So, if we had an array of: 5, 18, 4, 7, 11 The sum of sums would be (45+40+22+18+11) = 136. Hint: is the sum of sums not just the sum of the current array + the sum of sums of an array?
In: Computer Science
Using Ubuntu, what are the commands for the following:
Assume that your company just hired 3 new software developers. You are responsible for setting up a LDAP server and adding those three new employees into the LDAP database. Please complete the follow tasks:
dn:ou=People,dc=nodomain
objectClass:organizationalUnit
ou:People
dn:cn=SoftwareDeveloper,ou=People,dc=nodomain
objectClass:posixGroup
cn:SoftwareDeveloper
gidNumber:7000
In: Computer Science
Processes D, E, and F all send a message to a mailbox owned by process A. Who can receive the messages that arrive in the mailbox owned by A?
In: Computer Science
IN C++:
Create sets of 1 Million integer, where no integer is repeated. Insert these numbers to an AVL tree and an R-B tree.
Using a random number generator, select 10% of
the numbers in the trees and delete them.
Repeat the experiment 10 times. Report your answers in a tables
In: Computer Science
Write a program that will take a line of input and go through and print out that line again with all the uppercase letters swapped with the lowercase letters. JAVA
Using printf
In: Computer Science
can you convert this cod from C++ to C language
#include<bits/stdc++.h>
using namespace std;
// Function for finding sum of two large numbers
string addThese(string a,string b){
// Before proceeding further, make sure length
// of a is larger.
if(a.size() < b.size())
swap(a,b);
int j = a.size() - 1;
// Traverse from end of both strings and add (b[i] - '0') to
a[j].
for(int i = b.size() - 1; i >= 0; i--, j--)
//(b[i] - '0') is nothing but numerical value of string b
char
a[j] += (b[i] - '0'); // if(b[i] ascii value is 49 then we subtract
ascii value of '0'== 48 from it.
// be store all the values to a string now check ascii value of
a[i]
for(int i = a.size()-1; i > 0; i--) {
if (a[i] > '9') { // if a[i] is greater than ascii value of '9'
means value must be greater than 9
int d = a[i] - '0'; // calculate value of perticular digit by
subtracting ascii value of a[i]-'9'
a[i-1] = ((a[i-1] - '0') + d/10) + '0'; // carry will be added to
previous char values
a[i] = (d%10) + '0'; //current a[i] chang to (d%10) + '0'. if d is
11 than a[i] is 1 and carray be 1 added tp previous char.
}
}
if(a[0] > '9') // if first char ascii value is grater than ascii
value of '9' then ther is a another char has to be added
{
string c; // carry of the first digits
c = a[0];// first store c as a[0]
a[0] = ((a[0]-'0')%10)+'0'; // now change a[0] as modulo 10 of the
value
c[0] = ((c[0]-'0')/10)+'0'; // and chnge c to carry of a[0]
a = c + a; // now concatinate string c with string a
}
return a;
}
int main(){
ifstream in ("input.in");
if (in.is_open())
{
string a,b;
int count=0;
while(in>>a>>b)
cout <<"sample "<<++count<<" output: "<<
addThese(a,b) <<"\n";
in.close();
}
else cout << "Unable to open file";
return 0;
}
In: Computer Science
Problem 1: based on java.util.LinkedList class, create MyQueue class that should have the methods:enqueue(), dequeue(), peek(), size(), isEmpty().
Problem 2: Create a new Java Application that test MyQueue by having the following methods in main class:
A method to generate a number of element between two given values and save them in a queue
A method to print a queue (10 elements per line). The original queue should remain as is after the print
A method to exchange the first element and the last element in a queue
A Boolean method to search for a value in a queue. The queue should remain the same after the search is
finished.
A method to check if a queue is included in another queue (q1 is included in q2 if q1 is a sub-queue of q2). q1
and q2 should remain as they were originally.
A method to inverse a queue.
A method to make a copy of a queue into a queue (the original queue should remain as it is).
The main method that does
Create 2 queues Q1 and Q2
Insert 23 integers between 20 and 60 (do not insert duplicates) into Q1
Insert 35 integers between 10 and 80 (do not insert duplicates) into Q2.
Give the user the choice which methods (2-7) to call and option to exit
In: Computer Science
using java and use stack library java
Bashemin Parking garage
The Bashemin Parking Garage contains a single lane that holds up to ten cars. There is only a single entrance/exit to the garage at one end of the lane. If a customer arrives to pick up a car that is not nearest the exit, all cars blocking its path. are moved out, the customer's car is driven out and the other cars are restored in the same order that they were in originally.
Write a program that processes a group of input lines. Each input line contains an "A" for arrival or a "D" for departure and a license plate number. Cars are assumed to arrive and depart in the order specified by the input. The program should print a message whenever a car arrives or departs. When a car arrives, the message should specify whether or not there is room for the car in the garage. If there is no room the car leaves without entering the garage. When a car departs, the message should include the number of times that the car was moved out to allow other cars to depart.
You will submit a program listing (properly commented), your sample data (at least 20 lines of text) and the output.
In: Computer Science
You have been asked to carry out use case modelling to identify
the functional requirements for a new fitness app (provisionally
named FitFoodFastFacts) which is targeted at users who want to
track their food intake and balance it with their exercise profile
and goals, similar to the functionality provided by MyFitnessPal,
Fooducate, MyPlate, and others.
The target user of FitFoodFastFacts is anyone who is interested in
monitoring their food intake in order to gain a better
understanding of their nutrition, or to gain or lose weight.
Users will be able to customise the app for their own profile and
needs: for example, gender, age, height, weight, target weight,
target kilojoules and target macros (percentage of carbohydrates,
protein and fat consumed per day). They will also be able to record
their activities each day (run, swim, etc). They will be able to
select a food from the app’s database and record the quantity they
consumed of it at each meal. They will also have the ability to add
new nutritional information either manually or by scanning the
barcode of the product. The app will provide a range of useful
summaries of the personal data input by the user over various time
periods.
Use the user goal technique to identify all the use cases that
would be relevant to a potential user of the FitFoodFastFacts app.
Use the brief description above, your own experience or potential
requirements of such an app, and any research you need to do.
(a) Present your list in a table giving the use case name and an
informative brief description.
(b) Draw a use case diagram representing the same information
In: Computer Science
Question 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risksQuestion 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risksQuestion 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risksQuestion 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risks
In: Computer Science
Matlab
For a vector x=[1,10,-5,72,56,70,33] a) Use for loop to sum the vector x and count how many values are greater than 33. b) Repeat (a), this time a while loops.
In: Computer Science
Write a 6 pages report explaining Micro controllers based on the following classifications:
1) Bits - 4, 8 , 16, 32 .
2) Memory / device - Embedded , external.
3) Instruction set - CISC, RISC
4) Memory Architecture - Princeton, Harvard
5) Family - 8051, Motorola, PIC , Texas, National , ARM, Intel , Phillips, Siemens,.
From the 6 pages report, draft out a 3 page Powerpoint presentation explaining your report.
In: Computer Science
The goal of designing a direct manipulation interface is to make use of the system intuitive to the end user. Direct-manipulation interfaces are now being used for a wide range of purposes.
Describe how direct manipulation interfaces are designed in the following applications.
1. Checkbook maintenance and checkbook searching interface
2. Airline reservation system
In: Computer Science