In: Economics
c++
Write a program to complete the following tasks. Record all results to a data file called "GradeSheet.dat".
(1) Read the grade sheet from attached data file,
"Assignment4.dat". Print the original grade sheet.
(3) Write a module to sort array GRADE[] and print the sorted grade
sheet.
(4) Write a module to sort array NAME[] and print the sorted grade
sheet.
(5) Write a module to sort array ID[] and print the sorted grade
sheet.
(6) Write a module to print the student's id, name, and grade for
student with highest grade and with lowest grade,
respectively.
(7) Write a module to determine mean of the grades.
(8) Write a module to list students with grade is less than
mean.
*** Coding modules for Assignment 4
*** Using pointers for allocating all the arrays
Assignment 4
ID NAME GRADE
5532 Mary 100
7856 Tom 99.56
3345 Cathy 33.78
1229 Jim 89.42
2785 David 67.52
9954 Rob 99.25
2388 Sue 87.29
6523 Michael 60.55
1287 Zach 76.12
2783 Amy 90.55
In: Computer Science
Q:Make a requirements document highlighting all functional and non-functional requirements as per the case above. Your requirements must be validated for conciseness, completeness, non-ambiguity, verifiability, feasibility, and traceability:
Register for the system by providing their name, Student ID and email address and a password
Log in to the system by entering their Student ID and password
Search for textbooks (by title or ISBN number or author) and scroll through the results of their search. The results of their search should include the price and condition of the book.
Note that more than one of the same textbook may be returned by the search due to multiple students listing the same book. In this case the user should be presented with a list of results showing the different prices and conditions.
Purchase textbooks (by sending an email to the textbook buyer and owner indicating an intent to purchase)
Sell textbooks
The user will need to enter the title and ISBN number, price and condition of the book
Remove user's posted textbooks from the system (once the student has completed a sale, or if the user decides to not sell the textbook)
Display additional information about textbook search results, provided directly from Amazon, including an image of the textbook cover, price, authors, and the book description
In: Computer Science
In: Statistics and Probability
Part 9
If deposits in the banking system are $540, while the reserve ratio is 0.2 and the currency to deposit ratio is 0.09, then:
a) Calculate the total demand for high powered money.
b) Calculate the money multiplier.
(1 mark each for sub-parts a and b (no word count requirement applies) - Part 9 worth 2 marks)
Additional Requirements
1. Honesty pledge that you have completed the Course Experience Survey (CES).
Note: We value your feedback and want to encourage students to provide their feedback especially this semester when things have been so different (e.g. fully online classes, shift to final assessment as assignment instead of exam). Your responses on the CES are confidental, all you need to be to earn 0.5 mark for this is pledge that you have completed the CES. While there is no way we can in fact check this we hope you will be honest and motivated to complete the CES which you can access on Canvas via Student Surveys in the navigation menu.
(0.5 marks)
2. Include a Reference list to acknowledge sources used and cited within your assignment
(1 mark)
In: Economics
Approximately 1000 word report (800-1300 words excluding Conclusion) on ONE of the following topics: 1. Quantum Cryptography 2. Quantum Computing and its impact on Cryptography 3. Zero-knowledge protocols (or proofs) in Signature Schemes 4. Secret Sharing (or splitting) in Cryptography It is VERY important that references are included (Note: Wikipedia is NOT acceptable)
This assessment requires the student to choose a topic from a supplied list and write a report as if it were to be presented as a professional development lecture for their peers. The choice of topics may include but not be limited to, material covered throughout the subject. Potential topics not covered in lectures may include quantum cryptography and quantum computing. Students are expected to discuss their choice with their lecturer during the workshops. This assignment is designed to improve the student’s organisational skills and encourage independent research into other topics not directly covered in lectures. Please present your lecture in report format which includes the following sections: • Title page • Introduction • Body paragraph • Body paragraph • Body paragraph • Conclusion • References • Appendices (if necessary) The report should: • include diagrams explaining concepts • Include all references cited and must be referenced in Harvard AGPS
In: Computer Science
Exercise 1
Modify the List<T> class of Figure 21.3 in the textbook to include a method that recursively searches a linked-list for a specified value. Ensure that the name of your method includes your last name. The method must return a reference to the value if it is found; otherwise, it must return null. Use your method in a test program that creates a list of integers. The program must prompt the user for a value to locate in the list.
I need the code modified in java to pull out the correct input below is my code, but when ran the only out I get is "Enter integers(-1 to stop):" and nothing else
PLEASE HELP
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static <T> T search_mylastname(List<T> list, T
value, int index){//function name can be updated in all places to
the lastname if needed
if(list == null || index == list.size())
return null;
if(value.equals(list.get(index)))
return list.get(index);
return search_mylastname(list, value, index+1);
}
public static void main(String[] args) {
List<Integer> list = new ArrayList<>();
System.out.println("Enter integers(-1 to stop): "
+ "2, "
+ "4, "
+ "6, "
+ "8, "
+ "10");
int num;
Scanner sc = new Scanner(System.in);
while(true){
num = sc.nextInt();
if(num == -1)
break;
list.add(num);
}
System.out.print("Enter integer to search: ");
int key = sc.nextInt();
Integer res = search_mylastname(list, key, 0);
if(res == null)
System.out.println(key+" is not in list");
else
System.out.println(key+" is available in list");
}
}
In: Computer Science
Your primary task for this exercise is to complete header file by writing three functions with its description below:
removeAt function – to remove the item from the list at the position specified by location. Because the list elements are in no particular order (unsorted list), you could simple remove the element by swapping the last element of the list with the item to be removed and reducing the length of the list.
insertAt function - to insert an item in the list at the position specified by location. The item to be inserted is passed as a parameter to the function.
print function – to output the elements of the list.
3. Demonstrate the program by asking a user to enter 5 integers. After displaying 5 integers, ask the user the position of the item to be deleted. You can use your own data to generate two outputs.
Sample output 1:
Enter 5 integers: 45 19 2 16 77
The list you entered is: 45 19 2 16 77
Enter the position of item to be deleted: 2
After removing element at 2, the list is:
45 19 77 16
Sample output 2:
Enter 5 integers: 15 12 11 3 49
The list you entered is: 15 12 11 3 49
Enter the position of item to be deleted: 6
The location of the item to be removed is out of range
After removing element at 6, the list is:
15 12 11 3 49
======================================== C++
#ifndef H_arrayListType
#define H_arrayListType
#include <iostream>
#include <cassert>
using namespace std;
template <class elemType>
class arrayListType
{
public:
const arrayListType<elemType>& operator=
(const arrayListType<elemType>&);
//Overloads the assignment operator
void print() const;
//Function to output the elements of the list
//Postcondition: Elements of the list are output on the
// standard output device.
void insertAt(int location, const elemType& insertItem);
//Function to insert an item in the list at the
//position specified by location. The item to be inserted
//is passed as a parameter to the function.
//Postcondition: Starting at location, the elements of the
// list are shifted down, list[location] = insertItem;,
// and length++;. If the list is full or location is
// out of range, an appropriate message is displayed.
void removeAt(int location);
//Function to remove the item from the list at the
//position specified by location
//Postcondition: The list element at list[location] is removed
// and length is decremented by 1. If location is out of
// range,an appropriate message is displayed.
arrayListType(int size = 100);
//constructor
//Creates an array of the size specified by the
//parameter size. The default array size is 100.
//Postcondition: The list points to the array, length = 0,
// and maxSize = size
arrayListType(const arrayListType<elemType>& otherList);
//copy constructor
~arrayListType();
//destructor
protected:
elemType *list; //array to hold the list elements
int length; //to store the length of the list
int maxSize; //to store the maximum size of the list
};
// print function definition
template <class elemType>
void arrayListType<elemType>::print() const
{
// your code here
}
// insertAt function definition
template <class elemType>
void arrayListType<elemType>::insertAt
(int location, const elemType& insertItem)
{
// your code here
} //end insertAt
// removeAt function definition
template <class elemType>
void arrayListType<elemType>::removeAt(int location)
{
// your code here
} //end removeAt
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
template <class elemType>
arrayListType<elemType>::arrayListType(int size)
{
if (size < 0)
{
cerr << "The array size must be positive. Creating "
<< "an array of size 100. " << endl;
maxSize = 100;
}
else
maxSize = size;
length = 0;
list = new elemType[maxSize];
assert(list != NULL);
}
template <class elemType>
arrayListType<elemType>::~arrayListType()
{
delete [] list;
}
template <class elemType>
arrayListType<elemType>::arrayListType
(const arrayListType<elemType>& otherList)
{
maxSize = otherList.maxSize;
length = otherList.length;
list = new elemType[maxSize]; //create the array
assert(list != NULL); //terminate if unable to allocate
//memory space
for (int j = 0; j < length; j++) //copy otherList
list [j] = otherList.list[j];
} //end copy constructor
template <class elemType>
const arrayListType<elemType>& arrayListType<elemType>::operator=
(const arrayListType<elemType>& otherList)
{
if (this != &otherList) //avoid self-assignment
{
delete [] list;
maxSize = otherList.maxSize;
length = otherList.length;
list = new elemType[maxSize]; //create the array
assert(list != NULL); //if unable to allocate memory
//space, terminate the program
for (int i = 0; i < length; i++)
list[i] = otherList.list[i];
}
return *this;
}
#endif
==================================================================
#include <iostream>
#include "arrayListType.h"
using namespace std;
int main()
{
arrayListType<int> intList(100);
int counter;
int number;
int position;
cout << "Enter 5 integers: ";
for (counter = 0; counter < 5; counter++)
{
cin >> number;
intList.insertAt(counter, number);
}
cout << endl;
cout << "The list you entered is: ";
intList.print();
cout << endl;
cout << "Enter the position of item to be deleted: ";
cin >> position;
intList.removeAt(position);
cout << "After removing element at " << position
<< ", the list is:" << endl;
intList.print();
system("pause");
return 0;
}
/*
Enter 5 integers: 45 19 2 16 77
The list you entered is: 45 19 2 16 77
Enter the position of item to be deleted: 2
After removing element at 2, the list is:
45 19 77 16
*/
/*
Enter 5 integers: 15 12 11 3 49
The list you entered is: 15 12 11 3 49
Enter the position of item to be deleted: 6
The location of the item to be removed is out of range
After removing element at 6, the list is:
15 12 11 3 49
*/In: Computer Science
(Java)
Create a new linked list from two given arrays with the greater
element from each corresponding array element placed into the
linked list.
Given two arrays of varying size initialized with integers of
varying values, the task is to create a new linked list using those
arrays. The condition is that the greater element value from each
corresponding array element will be added to the new linked list in
the list position that maintains the integers in ascending order.
When the program has reached the end of the shorter array, the
remaining elements of the longer array will be added to the linked
list in such a way as to maintain the integers in the linked list
in ascending order.
In: Computer Science
def read_list():
"""
This function should ask the user for a series of integer values (until the user enters 0 to stop) and store all those values in a list. That list should then be returned by this function.
"""
def remove_duplicates(num_list):
"""
This function is passed a list of integers and returns a new list with all duplicate values from the original list remove.
>>> remove_duplicates([1, 2, 3, 2, 3, 4])
[1, 2, 3, 4]
>>> remove_duplicates([1, 1, 1])
[1]
>>> remove_duplicates([])
[]
"""
def main():
num_list = read_list()
print("Original list entered by user: ")
print(num_list)
no_duplicates = remove_duplicates(num_list)
print("List with duplicates removed: ")
print(no_duplicates)
In: Computer Science