Programming Homework Help

Create a Program Code C Programming Task

 

Background

1. Dynamic memory allocation

In this assignment, you will use malloc function to allocate dynamic function.

void * malloc(size_t size) allocates the requested memory, and returns a pointer to it, or returns NULL if the allocation fails.

You should always deallocate the memory with the void free(void *ptr) function when you are done using the memory.

  • For example, int * arr = (int *) malloc(10 * sizeof(int)); allocates the memory for 10 integers, and free(arr) releases the allocated memory.

You will use the valgrind tool to debug memory, and detect memory leak. Check this page for the various types of errors that you may have.

  • For example, to use a valgrind to check a program hw4 for memory errors with input file filename, run the following command:

> valgrind --tool=memcheck --leak-check=full ./hw4 filename

2. QSort

QSort is a generic function in C for sorting arrays. In this assignment, you will not need to implement the qsort function. Instead, you will need to read the qsort function and understand how to use this qsort function. The QSort algorithm is based on recusion. You will learn the algorithm later when we discuss recussion in class.

What do you need to do?

You need to complete the following functions:

  • int main(int argc, char * * argv) in main.c, this file contains your main function, which gets the names of the input and output files from the command line (argv[1] and argv[2]), allocate memory, and calls qsort.
  • int countInt(char* filename) in hw4.c
  • bool readInt(char* filename, int * intArr, int size) in hw4.c
  • bool writeInt(char* filename, int * intArr, int size) in hw4.c
  • int compareInt(const void *p1, const void *p2) in hw4.c

Programming Homework Help

Java 2 Programming and Auto Complete Task

 

I’m working on a java question and need guidance to help me understand better.

Is about autocomplete, 3 small classes need to be done 

Class 1

public class Term implements Comparable<Term> { /**
    * Initialize a term with the given query and weight.
    * This method throws a NullPointerException if query is null,
    * and an IllegalArgumentException if weight is negative.
    */
public Term(String query, long weight) { } /**
    * Compares the two terms in descending order of weight.
    */
public static Comparator<Term> byDescendingWeightOrder() { } /**
    * Compares the two terms in ascending lexicographic order of query,
    * but using only the first length characters of query. This method
    * throws an IllegalArgumentException if length is less than or equal
    * to zero.
    */
public static Comparator<Term> byPrefixOrder(int length) { } /**
    * Compares this term with the other term in ascending lexicographic order
    * of query.
    */
@Override public int compareTo(Term other) { } /**
    * Returns a string representation of this term in the following format:
    * query followed by a tab followed by weight
    */
@Override public String toString(){ } } 

Class 2

public class BinarySearch { /**
    * Returns the index of the first key in a[] that equals the search key,
    * or -1 if no such key exists. This method throws a NullPointerException
    * if any parameter is null.
    */
public static <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator) { } /**
    * Returns the index of the last key in a[] that equals the search key,
    * or -1 if no such key exists. This method throws a NullPointerException
    * if any parameter is null.
    */
public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator) { } 

Class 3

public class Autocomplete { /**
* Initializes a data structure from the given array of terms.
* This method throws a NullPointerException if terms is null.
*/
public Autocomplete(Term[] terms) { } /**
* Returns all terms that start with the given prefix, in descending order of weight.
* This method throws a NullPointerException if prefix is null.
*/
public Term[] allMatches(String prefix) { } } 

Programming Homework Help

California University Multi Threading and Parallel Processing Report

 

Use 3 resources for each discussion. Include at least 2-3 quotes from your sources enclosed in quotation marks and cited in-line by reference to your reference list for each discussion. Example: “words you copied” (citation) These quotes should be one full sentence not altered or paraphrased. Cite your sources using APA format. Use the quotes in your paragraphs. Write in essay format, not in bulleted, numbered, or other list formats.

No plagiarism or spinbot, please.

Discussion 01: Write at least 500 words discussing limitations and issues related to the use ff and ffbase packages for processing large datasets.

Discussion 02: Write at least 500 words explaining logistic regression and how it is used in the chronic kidney disease data set.

Discussion 03: Write at least 500 words discussing how the ff and ffbase packages enable users to process large datasets with R.

Discussion 04: Write at least 500 words comparing and contrasting multi-threading and parallel processing. Let me know if you have any questions. Thank you!

Programming Homework Help

California University of Management Text Mining Healthcare Discussion

 

Use 3 resources for each discussion. Include at least 2-3 quotes from your sources enclosed in quotation marks and cited in-line by reference to your reference list for each discussion. Example: “words you copied” (citation) These quotes should be one full sentence not altered or paraphrased. Cite your sources using APA format. Use the quotes in your paragraphs. Write in essay format, not in bulleted, numbered, or other list formats.

No plagiarism or spinbot, please.

Discussion 01: Write at least 500 words discussing how to use text mining to analyze how we can use text mining to improve healthcare.

Discussion 02: Write at least 500 words discussing how Cambridge Analytica used text mining to analyze to affect the 2016 US presidential election.

Discussion 03: Write at least 500 words discussing how risk management in the financial industry could be aided by text mining.

Discussion 04: Write at least 500 words discussing how text mining and anti-crime applications are making internet crime prevention easier.

Programming Homework Help

Arkansas Baptist College Age of Patien and Maximum Heart Rate Questionnaire

 

I’m studying and need help with a Programming question to help me learn.

1. What is the relationship between `age of patient` (i.e., `age`) and `maximum heart rate` (i.e., `thalach`)?

1. What is the relationship between `serum choloesterol in mg/dl` (i.e, `chol`) and `maximun heart rate achieved` (i.e., `thalach`) by whether `exercise induced angina` (i.e., `exang`)?

1. What is the distribution of patients’  `maximum heart rate` (i.e., `thalach`) across `exercised induced angina` (i.e., `exang`)?and here are codes :for question one :

heart_disease_data %>%

 ggplot(aes(x=age,

            y=thalach )) +

 geom_point()

for question two:

heart_disease_data %>%

 ggplot(aes(x=chol,

            y=thalach,

            color= exang)) +

 geom_point() 

for question three:  

heart_disease_data %>%

 ggplot(aes(x=thalach,

            fill= exang)) +

 geom_bar() 

and you can download data csv from this https://www.kaggle.com/kingabzpro/heart-disease-pa…

Programming Homework Help

IT 402 Saudi Electronic Cost of Operations and Low Resource Wastage Response

 

In this discussion board, you will post your answer to the question. You will also read and respond to 2 other classmate’s postings. This is an excellent way for you to interact with your colleagues and to share your thoughts about their answers in a critical way.

Topic of the Discussion (100 – 200 words)

What are the three main functions that an enterprise needs to perform to establish Process Quality? and provide an example about one of the quality functional deployment methodology and tools that translate the customer needs into the attributes of a product or service? and discuss this example in a context of any organization

Programming Homework Help

UCLA Html CSS Question

 

I’m working on a html / css exercise and need an explanation and answer to help me learn.

Hello, I have a HTML assignment due tomorrow that requires one page of work. I will provide all the necessary instructions needed to complete the assignment. This assignment may require some time but no longer than two hours. If you have any questions please feel free to contact me.

Programming Homework Help

Program to Calculate the Distance Between Cities on A Map Project

 

Program Information

Write a program to allow the user to calculate the distance between cities on a map.

Sounds pretty complicated, eh? Don’t worry, we’ll make a few simplifications here:

  • The distances are calculated in map units on the 2D map.
  • Each city is given a set of coordinates relative to some point on the map. We’ll call this origin (0,0).
  • There can only be a finite number of cities in the system at a given time (you decide this maximum).

But in order to make the system useful, we’ll have to add a few other features:

  • Each city has a name in addition to its coordinates (you can assume a maximum length for these names; but they must be able to hold spaces: Los Angeles, New York, etc.).
  • The user selects what action to take from a menu:
        1) Enter city Information
        2) calculate Distance between two cities
        3) Print All cities
        4) Quit
    

    Make sure you allow them to choose their options by both the number and the capitalized letter(s) of the choice.

  • They cannot calculate a distance until at least two cities have been entered.
  • When they have exactly two cities, assume they are the ends and print their distance.
  • When they have more than two cities, show them the list of cities and have them pick the two cities to calculate the distance between. Don’t let them choose the same city for both ends of the ‘trip’.
  • If your list is full and they choose to enter another city, have them choose to either NOT enter the new city or to overwrite one of the earlier cities (they choose which one). Print the list of cities for them to choose from. (Remember, you still can’t exceed your maximum list size!)