Questions
It is about C++linked list code. my assignment is making 1 function, in below circumstance,(some functions...

It is about C++linked list code. my assignment is making 1 function, in below circumstance,(some functions are suggested for easier procedure of making function.)

void remove_list(struct linked_list* list) //*This is the function to make and below is the explanation that should be written in given code.

"This function removes the list. When the list is removed, all the memory should be released to operating system (OS) so that OS lets other computer programs use this. While deleting the list, every node should be freed separately; free(list) will not remove every node in the list. To check whether the nodes are removed perfectly, for every deletion of a node, this function should print message “The node with value n (corresponding value) is deleted!” Also, if the whole list is deleted, this function should print message “The list is completely deleted: n nodes are deleted”."

Given code is written below,(There is a function to fill in last moment in this code)

linked_list.h: This is the header file of linkLQS.c that declares all the functions and values that are going to be used in linkLQS.c. You do not have to touch this function.

-----------------------------------------------------------------------

(Below code is about linked_list.h)

#include
#include
#include


struct linked_node{
   int value;
   struct linked_node* next;
   struct linked_node* prev;
};

struct linked_list{
   int type_of_list; // normal = 0, stack = 1
   struct linked_node* head;
   struct linked_node* tail;
   int number_of_nodes;
};

--------------------------------------------------------

#include "linked_list.h"
#include "string.h"
extern int list_exist;

struct linked_list* create_list (int number_of_nodes, int list_type)
{
   int a[number_of_nodes];
   int i, j;
   int bFound;

   if (number_of_nodes < 1)
   {
       printf("Function create_list: the number of nodes is not specified correctly\n");
       return NULL;
   }
   if(list_exist == 1)
   {
       printf("Function create_list: a list already exists\nRestart a Program\n");
       exit(0);  
   }
   if(list_type != 0 && list_type != 1)
   {
       printf("Function create_list: the list type is wrong\n");
       exit(0);  
   }
   struct linked_list * new_list = (struct linked_list*)malloc(sizeof(struct linked_list));
   new_list->head = NULL;
   new_list->tail = NULL;
   new_list->number_of_nodes = 0;
   new_list->type_of_list = list_type;

   //now put nodes into the list with random numbers.
   srand((unsigned int)time(NULL));
   if(list_type == 0)
   {
       for ( i = 0; i < number_of_nodes; ++i )
       {
           while ( 1 )
           {
  
               a[i] = rand() % number_of_nodes + 1;
               bFound = 0;
               for ( j = 0; j < i; ++j )
               {
                   if ( a[j] == a[i] )
                   {
                       bFound = 1;
                       break;
                   }
               }
               if ( !bFound )
                   break;
           }
           struct linked_node* new_node = create_node(a[i]);
           insert_node(new_list, new_node);
       }
   }
   else if(list_type == 1)
   {
       for ( i = 0; i < number_of_nodes; ++i )
       {
           while ( 1 )
           {
  
               a[i] = rand() % number_of_nodes + 1;
               bFound = 0;
               for ( j = 0; j < i; ++j )
               {
                   if ( a[j] == a[i] )
                   {
                       bFound = 1;
                       break;
                   }
               }
               if ( !bFound )
                   break;
           }
           struct linked_node* new_node = create_node(a[i]);
           push_Stack(new_list, new_node);
       }
   }
   list_exist = 1;
   printf("List is created!\n");
   return new_list;
}

struct linked_node* create_node (int node_value)//This functon is the example for reference of the assignment function
{
   struct linked_node* node = (struct linked_node*)malloc(sizeof(struct linked_node));
   node->value = node_value;
   node->next = NULL;
   node->prev = NULL;
   return node;
}

void insert_node(struct linked_list* list, struct linked_node* node)//This functon is the example for reference of the assignment function
{
   node->next = NULL;
   node->prev = NULL;

   if(list->head == NULL)       //if head is NULL, tail is also NULL.
   {
       list->head = node;
       list->tail = node;
       list_exist = 1;
   }
   else if(list->head == list->tail)
   {
       node->next = list->head;
       list->head->prev = node;
       list->head = node;
   }
   else if(list->head != list->tail)
   {
       node->next = list->head;
       list->head->prev = node;
       list->head = node;
   }
   (list->number_of_nodes)++;
}

void remove_list(struct linked_list* list)//
{
~~~~~~~~~~~ //your code starts from here
   int deleted_nodes = 0;//Please do not erase these sentences. you should cover these sentences!
   int deleted_node_value;
}
}

In: Computer Science

Relevant Range and Fixed and Variable Costs Third World Gamer Inc. manufactures components for computer games...

Relevant Range and Fixed and Variable Costs

Third World Gamer Inc. manufactures components for computer games within a relevant range of 500,000 to 1,000,000 disks per year. Within this range, the following partially completed manufacturing cost schedule has been prepared:

Components produced 500,000 750,000   1,000,000    
Total costs:
Total variable costs $600,000 (d)       (j)          
Total fixed costs 600,000 (e)       (k)          
Total costs $1,200,000 (f)       (l)          
Cost per unit:
Variable cost per unit (a)       (g)       (m)          
Fixed cost per unit (b)       (h)       (n)          
Total cost per unit (c)       (i)       (o)          

Complete the cost schedule below. Round costs per unit to the nearest cent.

Cost Schedule
Components produced 500,000 750,000 1,000,000
Total costs:
Total variable costs $600,000 $ $
Total fixed costs 600,000 $ $
Total costs $1,200,000 $ $
Cost per unit:
Variable cost per unit $ $ $
Fixed cost per unit
Total cost per unit $ $ $

In: Accounting

Canada is a trading nation, how will Canada adapt to post-Covid world in terms of value...

Canada is a trading nation, how will Canada adapt to post-Covid world in terms of value chain? What role does government have? What is the new normal?

In: Operations Management

A transect is an archaeological study area that is mile wide and 1 mile long. A...

A transect is an archaeological study area that is mile wide and 1 mile long. A site in a transect is the location of a significant archaeological find. Let x represent the number of sites per transect. In a section of Chaco Canyon, a large number of transects showed that x has a population variance . In a different section of Chaco Canyon, a random sample of 25 transects gave a sample variance for the number of sites per transect. Use an alpha = 0.1 to test the claim that the variance in the new section is greater than 37.9. Given 0.05 < P-Value < 0.1, will you reject or fail to reject the null hypothesis of independence? ​ Select one:

a. Since the P-Value is less than the level of significance, we reject the null hypothesis that the variance is equal to 37.9. At 0.1 level of significance, we conclude that the variance is greater than 37.9.

b. Since the P-Value is less than the level of significance, we fail to reject the null hypothesis that the variance is greater than 37.9. At 0.1 level of significance, we conclude that the variance is equal to 37.9.

c. Since the P-Value is greater than the level of significance, we fail to reject the null hypothesis that the variance is greater than 37.9. At 0.1 level of significance, we conclude that the variance is equal to 37.9.

d. Since the P-Value is greater than the level of significance, we fail to reject the null hypothesis that the variance is equal to 37.9. At 0.1 level of significance, we conclude that the variance is greater than 37.9.

e. Since the P-Value is less than the level of significance, we fail to reject the null hypothesis that the variance is equal to 37.9. At 0.1 level of significance, we conclude that the variance is greater than 37.9.

In: Math

“Blast it!” said David Wilson, president of Teledex Company. “We’ve just lost the bid on the...

“Blast it!” said David Wilson, president of Teledex Company. “We’ve just lost the bid on the Koopers job by $3,000. It seems we’re either too high to get the job or too low to make any money on half the jobs we bid.”

Teledex Company manufactures products to customers’ specifications and uses a job-order costing system. The company uses a plantwide predetermined overhead rate based on direct labor cost to apply its manufacturing overhead (assumed to be all fixed) to jobs. The following estimates were made at the beginning of the year:

Department
Fabricating Machining Assembly Total Plant
Manufacturing overhead $ 360,500 $ 412,000 $ 92,700 $ 865,200
Direct labor $ 206,000 $ 103,000 $ 309,000 $ 618,000

Jobs require varying amounts of work in the three departments. The Koopers job, for example, would have required manufacturing costs in the three departments as follows:

Department
Fabricating Machining Assembly Total Plant
Direct materials $ 3,600 $ 300 $ 2,000 $ 5,900
Direct labor $ 4,000 $ 600 $ 6,800 $ 11,400
Manufacturing overhead ? ? ? ?

Required:

1. Using the company's plantwide approach:

a. Compute the plantwide predetermined rate for the current year.

b. Determine the amount of manufacturing overhead cost that would have been applied to the Koopers job.

2. Suppose that instead of using a plantwide predetermined overhead rate, the company had used departmental predetermined overhead rates based on direct labor cost. Under these conditions:

a.Compute the predetermined overhead rate for each department for the current year.

b. Determine the amount of manufacturing overhead cost that would have been applied to the Koopers job.

4. Assume that it is customary in the industry to bid jobs at 150% of total manufacturing cost (direct materials, direct labor, and applied overhead).

a.What was the company’s bid price on the Koopers job using a plantwide predetermined overhead rate?

b.What would the bid price have been if departmental predetermined overhead rates had been used to apply overhead cost?

In: Accounting

Python query for below: There are different ways of representing a number. Python’s function isdigit() checks...

Python query for below:

There are different ways of representing a number. Python’s function isdigit() checks whether the input string is a positive integer and returns True if it is, and False otherwise. You are to make a more generalised version of this function called isnumeric().

Just like isdigit(), this function will take input as a string and not only return a Boolean True or False depending on whether the string can be treated like a float or not, but will also return its float representation up to four decimal places if it is True.

Remember that numbers can be represented as fractions, negative integers, and float only. Check the sample test cases to understand this better.

Input: One line of string. The string will contain alphabets, numbers and symbols: '/' '.' '^'

Output: One line with True/False and then a space and the number with 4 decimal places if it is true and ‘nan’ if it is false


Sample Input 1: .2
Sample Output 1:
True 0.2000

Sample Input 2: 1 /. 2
Sample Output 2:
True 5.0000

Sample Input 3: 3^1.3
Sample Output 3:
True 4.1712

Sample Input 4: 3/2^3
Sample Output 4:
False NaN
Explanation:
if '^' and '/' are both present then give False. Since it is ambiguous, 2^5/5 can be seen as 2^(5/5) or (2^5)/5 likewise 3/2^3 can be seen as 3/(2^3) or (3/2)^3

Sample Input 5: 1.2.3
Sample Output 5:
False NaN

Sample Input 6: -2.
Sample Output 6:
True -2.0000

In: Computer Science

Why do we speak to animals and why do we speak for animals?

Why do we speak to animals and why do we speak for animals?

In: Psychology

Create a ShoppingCart class in java that simulates the operation of a shopping cart. The ShoppingCart...

Create a ShoppingCart class in java that simulates the operation of a shopping cart. The ShoppingCart instance should contain a BagInterface implementation that will serve to hold the Items that will be added to the cart. Use the implementation of the Item object provided in Item.java. Note that the price is stored as the number of cents so it can be represented as an int (e.g., an Item worth $19.99 would have price = 1999).

Using the CLASSES BELOW Your shopping cart should support the following operations:

  •  Add an item

  •  Add multiple quantities of a given item (e.g., add 3 of Item __)

  •  Remove an unspecified item

  •  Remove a specified item

  •  Checkout – should "scan" each Item in the shopping cart (and display its

    information), sum up the total cost and display the total cost

  •  Check budget – Given a budget amount, check to see if the budget is large

    enough to pay for everything in the cart. If not, remove an Item from the shopping cart, one at a time, until under budget.

    Write a driver program to test out your ShoppingCart implementation.

*Item Class*

/**

* Item.java - implementation of an Item to be placed in ShoppingCart

*/

public class Item

{

private String name;

private int price;

private int id;//in cents

  

//Constructor

public Item(int i, int p, String n)

{

name = n;

price = p;

id = i;

}

  

public boolean equals(Item other)

{

return this.name.equals(other.name) && this.price == other.price;

}

  

//displays name of item and price in properly formatted manner

public String toString()

{

return name + ", price: $" + price/100 + "." + price%100;

}

  

//Getter methods

public int getPrice()

{

return price;

}

public String getName()

{

return name;

}

}

BAG INTERFACE CLASS

/**

* BagInterface.java - ADT Bag Type

* Describes the operations of a bag of objects

*/

public interface BagInterface<T>

{

//getCurrentSize() - gets the current number of entries in this bag

// @returns the integer number of entries currently in the bag

public int getCurrentSize();

  

//isEmpty() - sees whether the bag is empty

// @returns TRUE if the bag is empty, FALSE if not

public boolean isEmpty();

  

//add() - Adds a new entry to this bag

// @param newEntry - the object to be added to the bag

// @returns TRUE if addition was successful, or FALSE if it fails

public boolean add(T newEntry);

  

//remove() - removes one unspecified entry from the bag, if possible

// @returns either the removed entry (if successful), or NULL if not

public T remove();

  

//remove(T anEntry) - removes one occurrence of a given entry from this bag, if possible

// @param anEntry - the entry to be removed

// @returns TRUE if removal was successful, FALSE otherwise

public boolean remove(T anEntry);

  

//clear() - removes all entries from the bag

public void clear();

  

//contains() - test whether this bag contains a given entry

// @param anEntry - the entry to find

// @returns TRUE if the bag contains anEntry, or FALSE otherwise

public boolean contains(T anEntry);

  

//getFrequencyOf() - count the number of times a given entry appears in the bag

// @param anEntry - the entry to count

// @returns the number of time anEntry appears in the bag

public int getFrequencyOf(T anEntry);

  

//toArray() - retrieve all entries that are in the bag

// @returns a newly allocated array of all the entries in the bag

// NOTE: if bag is empty, it will return an empty array

public T[] toArray();

  

}

In: Computer Science

simple Java project// All variables have descriptive names or comments describing their purpose. Thank you Read...

simple Java project//  All variables have descriptive names or comments describing their purpose. Thank you

Read from a file that contains a paragraph of words. Put all the words in an array, put the valid words (words that have only letters) in a second array, and put the invalid words in a third array. Sort the array of valid words using Selection Sort. Create a GUI to display the arrays using a GridLayout with one row and three columns. 

The input file Each 
line of the input file will contain a sentence with words separated by one space. Read a line from the file and use a StringTokenizer to extract the words from the line. An example of the input file would be: 
Mary had a little lamb
whose fl33ce was white as sn0w
And everywhere that @Mary went
the 1amb was sure to go. 

You should have two files to submit for this project: 
Project1.java 
WordGUI.java

In: Computer Science

Create Five Annotated Bibliographies of operational challenges of Small and Medium Companies

Create Five Annotated Bibliographies of operational challenges of Small and Medium Companies

In: Operations Management

Discuss in 300 words regression, analysis, assumptions? can you please type it, it is really hard...

Discuss in 300 words regression, analysis, assumptions?

can you please type it, it is really hard to read some handwriting?

In: Math

The Hangover Part II has been a hotbed of intellectual property issues. Warner Brothers recently settled...

The Hangover Part II has been a hotbed of intellectual property issues. Warner Brothers recently settled a lawsuit brought by the tattoo artist who did Mike Tyson’s facial tattoo that was then replicated on a character in the movie. Please read Problem 4 on page 549 of the book (Chapter 15) and answer the following questions:

What is the issue in the use of trademarked products in artistic works?

Why is Louis Vuitton so concerned about the use of its products in a film such as the Hangover Part II?

In: Operations Management

Answer these few questions on marketing a Jeep SUV. 1. Of the three levels of the...

Answer these few questions on marketing a Jeep SUV.

1. Of the three levels of the Consumer problem solving, to which one(s) does Jeep appeal?

2. Referring to the psychological factors that impact consumer behavior, which three variables Jeep is trying to influence? (1 point)

3. How should Jeep alter their approach to fit the consumer behavior of the Millennials? (1 point)

4. Describe the five-stage purchase decision process for a Jeep customer.

In: Operations Management

What are the important features of a limited liability company? Explain.​

What are the important features of a limited liability company? Explain.​

In: Operations Management

Answer the following question: What are the origins of the romans? How did they go from...

Answer the following question:

What are the origins of the romans?

How did they go from being peasants tilling the land, to conquerors of the world around them in the mediterranean?

How is the conflict between Plebeians and Patricians still in force?

How did the concept of "caesar" arise?

What is Pax Romana? Have you ever felt pax?

How did Octavio emerge?

In: Psychology