Questions
write these programs in c++ using getch() function Write a program that reads 20 integers from...

write these programs in c++ using getch() function

Write a program that reads 20 integers from a user using a while loop and determines and prints whether each of those integers is an even number.

Write a program that uses a while statement to read integers from a user and prints the sum, average, and largest of these numbers. The input should terminate if the user enters -1.

In: Computer Science

In Java, a set of integers is given. write a function to find 2 integers in...

In Java, a set of integers is given. write a function to find 2 integers in this set that sums upto a target value.

i.e [1,5,2,0,11,3] target = 7

result [5,2]

i.e [1,5,4,0,14,-7] target = 9

result [5,4]

NOTE: THE SAME INTEGER CANNOT BE USED TWICE !!!

In: Computer Science

IN C++: Create sets of 1 Million integers with the following characteristics; Sets where no numbers...

IN C++:

Create sets of 1 Million integers with the following characteristics;
Sets where no numbers repeat
Sets where the range of numbers is 1% of the array size
Sets where no numbers repeat and each integer has 20 digits

In: Computer Science

consider the victoria university information technology department, department has setup a small library for NIT5130 students....

consider the victoria university information technology department, department has setup a small library for NIT5130 students. The department library maintains a checkout list ( CALL NO, USER ID, DATE REQUESTED) of all the books borrowed by students, Every student record consists of User ID, User name, Borrow limit, Number checked out, and fines. Suppose that the library will have multiple copies (CALL NO, AUTHOR NAME, PUBLISHER, ISBN, DATE PUBLISHED) can have multiple authors (AUTHOR NAME, DATE OF BIRTH, COUNTRY OF BIRTH, DECEASE BIRTH). You have volunteered to set up a database system for the library,

Draw an Entity relationship diagram for the IT department library

In: Computer Science

How can I return in a list all possible paths from a grid if I can...

How can I return in a list all possible paths from a grid if I can only go right and down?

For example consider the following table:

A B C

D E F

If I go right I need to insert in my list 'H' if I go down I need to insert in my list 'V'.

For example the path A - > B -> C -> F would be H - H - V

The path A -> D -> E -> F would be V - H - H

How would be the code for that? Please preference write in JAVA.

Thank you,

In: Computer Science

Please solve this problem, in c++ (algoritms) write code and explaination how to solve it! 1)...

Please solve this problem, in c++ (algoritms) write code and explaination how to solve it!

1) N numbers are given. The first K of them are sorted in ascending order, the remaining NK are also sorted in ascending order. Sort numbers in ascending order in O (N).

Input data format N - number of numbers, K - number of numbers in the first half (sorted).

Example input

10 6

1 2 5 6 8 9 3 4 7 12

Sample Output

1 2 3 4 5 6 7 8 9 12

In: Computer Science

6.5 The time taken by machines A, B, and C to execute a given task is...

6.5 The time taken by machines A, B, and C to execute a given task is

A 16m, 9s

B 14m, 12s

C 12m, 47s

What is the performance of each of these machines relative to machine A?

6.6 Why is clock rate a poor metric of computer performance? What are the relative strengths and weaknesses of clock speed as a performance metric?

6.7 What are the relative strengths and weaknesses of the MIPS as a metric of computer performance?

In: Computer Science

Using python: In the directory rootdir some of the files contain randomly generated content while others...

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...

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,...

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...

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:

  1. Installing and configuring a OpenLDAP server on your Ubuntu server
  2. Set the domain component (dc) = nodomain
  3. Insert an organization unit node into the LDAP database:

dn:ou=People,dc=nodomain

objectClass:organizationalUnit

ou:People

  1. Insert a group node into the LDAP database:

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....

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...

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...

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...

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