Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] Csc 390 project 4 – database interaction

One of the most common uses for PHP is to interact with databases. This project will build on concepts used in the previous project and add database interaction and, optionally, AJAX. Your task is to create a website where people may create an account and then login. Once logged in, they will be able to see and maintain a list of video games they’d like to play or have played (game backlog) Since this isn’t a database course, I have provided the SQL script to generate the database. You will be responsible for writing database queries though. You may work in groups of up to 3 people. Please let me know if you’ll be working in a group. Feature Requirements This project is similar to how projects work in the real world. You are given a set of required features below and it is your job to create an application with those features. How you accomplish this is up to you. This allows you to be creative, but also challenges you like you’ll be challenged in the real world. Account Registration • Users must create an account in order to log in. An account should just have name, email, and password. • If a user attempts to access certain pages without being logged in, you should redirect them to the login page. • Users should be able to log in using their email/password combination. • You should store all user accounts in a database. Game Backlog • Once a user is logged in, they should be able to see their video game backlog. It should show all the games in the backlog. There should be a place to add new games to the list. • For each game on the list, it should be possible to remove the game, mark the game as “started”, and mark the game as “completed”. • When a game is started or completed, you should record (in the database) the date and time. When showing started or completed games on the page, you should show this completed date. • At the top of this page, give options to filter the backlog in three different way: All games, started games, and completed games. The “started games” filter should only show games that have been started but not completed. • Remember, each user should only see their list! If one user logs in and can see another user’s list and something is horribly wrong!Technical Requirements In addition to the feature requirements, there are some technical requirements that you must meet. • You MUST store passwords for accounts hashed! This means using the password_hash() and password_verify() functions built into PHP as of version 5.5 (we’re using 8.1). • All user accounts and games will be stored in a MySQL database using a schema I provide for you. You may modify this schema if you would like to add additional features, but other than that you must use it as is. • All database queries MUST be done using “prepared statements” with bound parameters. This means using the PHP library called PDO. • Your site must be styled with CSS. You should have a single CSS file for all your pages. Styling is still worth points and you should put some effort into it. Try to make the site look appealing and like something you’d want to use in the real world. • Extra Credit: When adding a new game to a backlog, do an AJAX call to create the database record and then use JavaScript to add the new game to the list. This will allow users to add games to the backlog without having to reload the entire page. You could do other AJAX functionality if desired. • It is important your project works correctly on Thor! This is where I will be testing them, so if your site isn’t at the correct path and doesn’t work on Thor you will lose points! Tips and Hints • Install XAMPP so you can work locally! • Become comfortable with a database administration tool (phpMyAdmin or MySQL Workbench) for creating, editing, and viewing your database. • If you have common functionality, consider putting that in a class in a separate file and including that when needed. • Every user will have an ID. Store this ID on the session so you can keep track of which user is currently logged in and know what lists they are allowed to view. • Try to separate logic and presentation. In class I’ve gone over the concept of a ‘template file’ which may be useful. • MySQL stores dates in the format YYYY-MM-DD HH:MM:SS (that is, year-month-day then hours:minutes:seconds). You can create a timestamp in this format using PHP’s date() function. • To do AJAX use JavaScript’s Fetch API or Axios. I can help with these.Plan of Attack! Do not attempt to do this project all at once. This project is larger than past projects and will take longer. The best thing for you to do is to do this project piece-by-piece. Do one part of it, once you have that part finished then move on to the next part. Repeat that until your project is done! Here’s how I would tackle this project. 1. Start on this project immediately. 2. Set up some a database administration tool to make it easier to interact with your database. 3. Ask me for help if you need it! 4. Using the SQL file I provided, create the database. 5. Create the user registration page, just the actual HTML form. 6. Get the form submitting and when it submits have PHP read the form data and write a record to the ‘user’ table doing proper password hashing. 7. Ask me for help if you need it please? 8. Using project 3 as a guide, get your login page made and login functionality working. This should be very similar to project 3, you’ll just be checking their login credentials against a database instead of hardcoded values. 9. Once all the login functionality is working, create a page that does a database query to get and then display the user’s game backlog. 10. Add a form to this page which allows them to add a new game to their backlog. Once you have this form made, make the submit program which reads this form data and creates a new record in the backlog table. 11. I’m not kidding ask me for help if you need it! 12. Add the ‘Delete’ link or button for each game which will delete that game. 13. Create the page which deletes the game. 14. Add ‘started’ link or button for each game which will mark that game as started. 15. Create the page which marks the game as started. 16. Add ‘completed’ link or button for each game which will mark that game as completed. 17. Create the page which marks the game as completed. 18. Add the ability to filter the list to “all”, “started”, and “completed” 19. You’re done at this point! There may be a few small features left to add, but you’re basically feature complete! 20. Now style your app using CSS to make it look better. 21. You’re totally done! Stop unless you want extra credit. 22. Get ready to ask me for help with the AJAX stuff. It can get complicated. 23. Once you have all this working, now attempt to get the add game form working using AJAX. This means using JavaScript to get the form data, do an AJAX call, get a response from the server, and then adding a new game to the list on the page.Grading The assignment is worth 300 points. You will be graded on the following criteria: User Registration & Login work 60 View games on the backlog 60 Add and delete games from the backlog 40 Mark games as started or completed 20 Ability to filter backlog 30 All database interaction done properly 30 CSS styling 20 Site works on Thor 20 Code quality/header comment blocks 20 Total 300 Submitting your work Your work should be submitted as an archive (.zip, .7z, .rar) on Moodle. This archive should include your all files needed for your project. This project is due Monday, December 9th at 12:55pm. Late submissions will not be accepted! (yes this is 5 minutes before the start of our final time so we can demo the projects in class)

$25.00 View

[SOLVED] Assignment 4 csc300

Design, specify, and implement a class that is similar to an array of double numbers (name it DoubleArray) except that it automatically grows when needed, and negative indexes are also permitted. The class should include:– a method to put a double number into the ‘array’ at a specified index. For example, suppose that array in a object of the class. Then argval(3,8, 7) would put the number 3.8 at index 7 of the ‘array’. Since negative indexes are also allowed, the statement arr.put(9,1, -3) would put the number 9.1 at the index -3. If you use the method to update a value in a full array, the array’s size will be doubled. – The class also includes a method to retrieve the number from a specified index. For example, arr.get(7) would return the value of the number that is currently at index 7 of the “array.” If a user tries to get a value that has not yet been put into the array, then the get method will return the Java constant Double-NaN (which is the way Java represents a double value that is not a real number). – The class should also have two methods that return the value of the largest and the smallest _indexes_ that have ever been set with the put method. If no numbers have yet been put in the “array,” return the “smaller” index should be Integer.MIN_VALUE and the “largest” index should be Integer. MAX_VALUE.You are not allowed to use the ArrayList or any helper methods from the Java Array API. However, you are allowed to use System.arraycopy() as an exception. Students will lose 60% of the assignment grade if the code has been implemented differently than what is stated in the assignment description.Examine the provided driver class and its output to guide the design and implementation of the class. You’ll need to incorporate constructors, helper methods, mutators, and accessors. When you execute the code, ensure that your program generates the output as demonstrated in the sample session.—### The Driver: import java.util.*;public class DoubleDriver {public static void main(String[] args) { // printing array info DoubleArray myarr = new DoubleArray(); System.out.println(“The size of the array is “+ myarr.size()); System.out.println(“The largest index is ” + myarr.largest()); System.out.println(“The smallest index is ” + myarr.smallest()); System.out.println();// filling the array myarr.put(5,5,0); myarr.put(1,5,1); myarr.put(220,2); myarr.put(3,5,3); myarr.put(5,32,4); myarr.put(422,5); myarr.put(5,9,0); myarr.put(0,5,7); myarr.put(55,5,8); myarr.put(9,5,9);// printing the array again System.out.println(“The elements in the array are.”); for (int i = 0; i < myarr.size(); i++) { System.out.print(myarr.get(i) + ” “); System.out.println(“n”); System.out.println(“The largest index in the array is ” + myarr.largest()); System.out.println(“The smallest index in the array is ” + myarr.smallest()); System.out.println();// filling the array backward myarr.put(20,4,1); myarr.put(30,2,2); System.out.println();System.out.println(“Again, the elements in the array are.”); for (int i = 0; i < myarr.size(); i++) { System.out.print(myarr.get(i) + ” “); System.out.println(“n”);

$25.00 View

[SOLVED] Csc300 assignment 2 warm-up programming assignment

Write a Payroll class and name it Payroll.java. This class should use the following three arrays as fields:– employedId: | 5658845 | 4520125 | 7895122 | 8777541 | 8451277 | 1302850 | 7580489 |– hours: hold the number of hours worked by each employee | 0 | 0 | 0 | 0 | 0 | 0 | 0 |– payRate: hold each employee’s hourly pay rate | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |The class should relate the data in each array through the subscripts. For example, the number in element 0 of the hours array should be the number of hours worked by the employee whose identification number is stored in element 0 of the employedId array. That same employee’s pay rate should be stored in element 0 of the payRate array.In addition to writing the appropriate accessor and mutator methods, the class should have a method that accepts an employee’s identification number as an argument and returns the gross pay for that employee. The number of employee should be a public constant class member.The class will be tested and driven using different drivers; therefore, write the code exactly as the requirements outlined. In the comments section of your java file, write the Big-O time analysis of your methods.Notes: 1. The program must compile without syntax errors; 50% of the assignment points will be deducted if your program does not compile, even if your program is “essentially” correct.2. To get full credit for an assignment, your program must solve the assignment problem completely.3. Please add comments to the source code. Your program should have a reasonable amount of comments.4. At the very beginning of each file, there should be a block comment containing the student name, course number, and assignment number.5. Follow the programming styles and guidelines discussed in class, such as using meaningful names for variables and camel case conventions for variables, classes, etc.6. Using ChatGPT or any LLM is not allowed. Your code will be examined if written using an AI tool.

$25.00 View

[SOLVED] Assignment 3 csc300 part 1: write a java test program to experimentally compare the performance of the sorting algorithms

Part 1: Write a Java test program to experimentally compare the performance of the sorting algorithms discussed in class, namely selection sort, bubble sort, and insertion sort. Use the random method from the Math class to generate 5000 integers, and then store these generated numbers in an array. Sort the elements in the array using the sorting algorithms, and for each execution, record the time it takes to sort the numbers. Measure the execution time of each operation using the System.currentTimeMillis() method.SYNOPSISpublic static long currentTimeMillis()DESCRIPTION: Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.[1]Returns: Reference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.[1]Example: long start = System.currentTimeMillis(); // recording the time before the loop is executed for(long j=0;j

$25.00 View

[SOLVED] Assignment 6 csc300

In the class, you used the **Stacks class** to write a method that recognizes palindromes, where palindromes are strings that read the same backward as forward. However, another kind of palindrome exists in which we examine words rather than individual letters. A word-by-word palindrome is a string of words in which the words read the same forward and backward. For example, the quote “You can cage a swallow, can’t you, but you can’t swallow a cage, can you?” is a word-by-word palindrome, i.e. and modify the Dequeter class (Question 4.2) to write a program that tests an input string and declares whether it is a word-by-word palindrome. Consider upper-and lowercase letters to be the same letter. Define a word as any string consisting of only letters or an apostrophe and bounded at each end with one of the following: a space or the end of the line. Your program should feature user-friendly interface and allow a user to check more lines until she wishes to quit the program. You are free to use any Java string tokenizer of your choice for word splitting.—### – Dequeter class:class Deque { private int maxSize; private long[] dekArray; private int left; private int right; private int nItems; //— public Deque(int s) // constructor { maxSize = s; dekArray = new long[maxSize]; int center = maxSize/2 – 1;left = center+1; // left and right right = center; // start out “crossed” nItems = 0; }//— public void insertLeft(long j) // put item at left of deque { if(left == 0) // deal with wraparound left = maxSize; dekArray[–left] = j; // insert and decrement left nItems++; // one more item }//— public void insertRight(long j) // put item at right of deque { if(right == maxSize-1) // deal with wraparound right = -1; dekArray[++right] = j; // insert and increment right nItems++; // one more item }//— public long removeLeft() // take item from left of deque { long temp = dekArray[left++]; // get value and incr left if(left == maxSize) // deal with wraparound left = 0; nItems–; // one less item return temp; }//— public long removeRight() // take item from right of deque { long temp = dekArray[right–]; // get value and decr right if(right == -1) // deal with wraparound right = maxSize-1; nItems–; // one less item return temp; }//— public boolean isEmpty() // true if deque is empty { return (nItems==0); }//— public boolean isFull() // true if deque is full { return (nItems == maxSize); }//— public int size() // number of items in deque { return nItems; }//— public void display() { System.out.print(“Array: “); for(int j=0; j

$25.00 View

[SOLVED] Csc300 assignment 7

In chapter 4, we studied the StackX class and learned how to implement a stack using an array. Unfortunately, the stack we created was limited by the length of the underlying array, and it can store only one data type. In the subsequent chapters, we learned how to make a dynamic data structure and create generic classes to overcome the mentioned issues. In this assignment, you will create a _generic_ class for a dynamic stack that can store data of any type, both primitive and non-primitive type.## Specifically, your class should contain1. No-arg constructor // Initialize an empty stack. 2. Push(E item) method // Push a new item onto the stack. 3. Pop() method // Get the top item, removing it from the stack. 4. Peek() method // Get the top item of the stack without removing the item. 5. IsEmpty() method // determine whether the stack is empty. Returns true if this stack is empty; otherwise, false. 6. Size() method // Accessor method to determine the number of items in the stack. Returns the number of items in this stack. 7. Clone() method // Generate a copy of the stack. The return value is a copy of the stack. Subsequent changes to the copy will not affect the original, nor vice versa. 8. Display() method // Print the contents of the stack.To earn full credit, you must demonstrate the class with a driver program. The driver should test the following cases:1. Create (declare) an integer stack: a- Print the stack (the stack is empty). b- Pushing items onto the stack. c- Print the stack (You need to use the size() to iterate over the stack). d- Generate a copy of this stack. e- Remove several items from the original stack (using pop() method). f- Print the original stack and its clone.2. Create (declare) a string stack: a- Print the stack (the stack is empty). b- Pushing items onto the stack. c- Print the stack (You need to use the size() to iterate over the stack). d- Generate a copy of this stack. e- Remove several items from the original stack (using pop() method). f- Print the original stack and its clone.Notes:1. The program must compile without syntax errors; 50% of the assignment points will be deducted if your program does not compile, even if your program is “essentially” correct. 2. To get full credit for an assignment, your program must solve the assignment problem completely. 3. Please add comments to the source code. Your program should have a reasonable amount of comments. 4. At the very beginning of each file, there should be a block comment containing the student name, course number, and assignment number. 5. Follow the programming styles and guidelines discussed in class, such as using meaningful names for variables and camel case conventions for variables, classes, etc. 6. Using ChatGPT or any LLM is not allowed. Your code will be examined if written using an AI tool. 7. You are not allowed to use the ArrayList class or any method from the Array APIs (except System.arraycopy()) to implement this assignment – you will lose 60% of the points if your code is implemented using the mentioned APIs. 8. To submit your Java files on Moodle: a. Create a folder with your last name. b. Place your Java files inside the folder. c. Zip the folder. d. Upload it to Moodle.

$25.00 View

[SOLVED] Assignment 5 csc300

Add the following methods to the Stack class (Stack.java):1. A class method to display the contents of the stack from top to bottom. 2. A class method to display the contents of the stack from bottom to top. 3. An instance method called flip() that reverses the order of the stack elements. 4. An instance method called itemA(int n) that returns the element that is n from the top without changing the stack contents.Write a new driver class that demonstrates these new methods.Sample Run:Testing the flip method… Let’s push some items onto the stack: pushing 20 pushing 40 pushing 60 pushing 80 Let’s flip the stack now … and print the stack from bottom to top … 80 60 40 20Let’s flip it one more time … and print it from top to bottom … 80 60 40 20Now let’s print the element at n equals 2: 40 What about at n equals 100 ? Error: 100 out of range. Done!—Notes:1. The program must compile without syntax errors; 50% of the assignment points will be deducted if your program does not compile, even if your program is “essentially” correct. 2. To get full credit for an assignment, your program must solve the assignment problem completely. 3. Please add comments to the source code. Your program should have a reasonable amount of comments. 4. At the very beginning of each file, there should be a block comment containing the student name, course number, and assignment number. 5. Follow the programming styles and guidelines discussed in class, such as using meaningful names for variables and camel case conventions for variables, classes, etc. 6. Using ChatGPT or any LLM is not allowed. Your code will be examined if written using an AI tool. 7. To submit your Java files on Moodle: a. Create a folder with your last name. b. Place your java files inside the folder. c. Zip the folder. d. Upload it to Moodle.

$25.00 View

[SOLVED] Assignment 8 csc300

Write a method that starts with a single linked list of doubles and a special value called the splitting value. The elements in the list are not in any particular order. The method should divide the nodes into two linked lists: one containing all the nodes that have an element less than the splitting value and another containing all the remaining nodes. If the original linked list contains any repeated doubles, meaning it has two or more nodes with the same element, the new linked list for that element should also have the same number of nodes that repeat this element. It does not matter whether you preserve the original linked list or destroy it in the presence of building the two new lists, but your comments should document what happens to the original linked list. The method should return two head references, one for each of the linked lists that were created. Use the LinkedList class to create your linked list. Also, use the following main method in your driver.Use the Link and LinkList classes to create your linked list. Also, use the following main method in your driver:public static void main(String[] args) { LinkList theList = new LinkList(); // make list Link firstHead = null; Link secondHead = null; theList.insertFirst(22, 2.99); // insert 4 items theList.insertFirst(44, 4.99); theList.insertFirst(66, 6.99); theList.insertFirst(88, 8.99); theList.displayList(); // display list Link f = theList.find(4.99); // find item if(f != null) { Link arr[] = new Link[2]; arr = theList.split(44); firstHead = arr[0]; secondHead = arr[1]; while(firstHead != null) // until end of list, { firstHead.displayLink(); // print data firstHead = firstHead.next; // move to next link } System.out.println(); while(secondHead != null) // until end of list, { secondHead.displayLink(); // print data secondHead = secondHead.next; // move to next link } } else{ // your code } } // end main } // end class**To submit your Java files on Moodle:** 1. Create a folder with your last name. 2. Place Link.java, LinkList.java and your driver file into the folder. 3. Zip the folder. 4. Upload it into Moodle.

$25.00 View

[SOLVED] Assignment 3 csc250

Write a C program that generates a histogram of student grades for a particular assignment. The program should read each student’s grade as an integer number, however, the grades will be entered as command-line arguments. In calculating the histogram, the minimum value of a grade is 0, but your program should determine the maximum value entered by the user. Use the atoi() library function to convert the entered string argument to an integer number.By incorporating error handling mechanisms and statistical analysis into your program, you can enhance its robustness and provide valuable insights, ensuring a more comprehensive and reliable solution.Error Handling:1. Check if grades are within the valid range (0-100) and display an error if not. 2. Ensure the correct number of command-line arguments is provided.Statistics Calculation: 1. Calculate and display the mean (average) of the grades. 2. Determine and display the median grade.Sample Run 1:./histogram 20 30 4 20 110 30 30 Histogram: Number of 4’s: 1 Number of 20’s: 2 Number of 30’s: 3 110 is Invalid input Mean: 19.3 Median: 25Sample Run 2:./histogram Error

$25.00 View

[SOLVED] Assignment 6 csc250

Create a program that reads multiple lines of text and generates a table displaying the count of one-letter words, two-letter words, three-letter words, and so on, with the assumption that the words consist solely of English letters and have a maximum length of 10 characters.Sample Run:./HW6Enter your string: Whether ’tis nobler in the mind to suffer| Word Length | Occurrence | |—|—| | 1 | 0 | | 2 | 2 | | 3 | 1 | | 4 | 2 | | 5 | 0 | | 6 | 2 | | 7 | 1 | | 8 | 0 | | 9 | 0 | | 10 | 0 |Requirements:1. You must use pointer /offset notation in this assignment instead of array notation. For instance, if you have an array named a, to access its content under subscript 5, you must write: *(a + 5) instead of a[5]. Please note that points will be deducted if this requirement is not followed.2. Your program must compile and run without errors using the gcc compiler on the thor server.

$25.00 View

[SOLVED] Assignment 9 csc250

For this task, your assignment is to create a C program that utilizes stream-level I/O functions to perform two main tasks with text files. Firstly, the program should read the contents of a text file named input.txt and count the number of lines in the file. Secondly, it should create a new text file named output.txt and write all the lines from input.txt to this newly created file.Your program should handle file I/O operations carefully, checking for errors during file opening and closing processes. It should display the total number of lines in the input.txt file after processing.Ensure that your program is well-organized, and comments explaining the logic behind each step.Sample Run:./a.out input.txtoutput.txt file has been created.20 lines have been copied to output.txt

$25.00 View

[SOLVED] Assignment 7 csc250

You are tasked with creating a simple program to manage book records in a library. You will use C structs and pointers to implement the system. Each book in the library has the following information:– Title (string) – Author (string) – ISBN (string) – Year of publication (integer) – Available copies (integer) – Total copies (integer)Your program should allow the following operations:1. Add a new book to the library. 2. Display the details of a specific book based on its ISBN. 3. Display a list of all books in the library. 4. Update the number of available copies for a book. 5. Delete a book (along with its copies) from the library.You must use pointer / offset notation in this assignment instead of array notation. For instance, if you have an array named a, to access its content under subscript 5, you must write: “(a + 5) instead of a[5]. Please note that points will be deducted if this requirement is not followed.**Requirements:**1. Create a struct to represent a book’s information. 2. Implement a dynamic data structure to store multiple book records (an array of size 100). 3. Implement functions for each of the operations listed above. 4. Display appropriate messages to inform the user of the success or failure of each operation. 5. Implement a menu-driven interface for the user to interact with the program. 6. You must write the c files for the corresponding header files:—### addBook.h: void addBook(struct Book* library, int* bookCount);disployBookByISBN: void displayBookByISBN(struct Book* library, int bookCount);displayAllBooks.h: void displayAllBooks(struct Book* library, int bookCount);updateAvailableCopies.h: void updateAvailableCopies(struct Book* library, int bookCount);deleteBook.h: void deleteBook(struct Book* library, int* bookCount);8. You must write an appropriate Makefile.Using the following main.c to test your c files.int main() { struct Book* library = (struct Book*)malloc(100 * sizeof(struct Book)); int bookCount = 0;if (library == NULL) { printf(“Memory allocation failed. Exiting: ”); return 1; }int choice; while (i) { printf(“ Welcome to the Library Book Record System ”); printf(“1. Add a new book ”); printf(“2. Display book details by ISBN ”); printf(“3. Display all books ”); printf(“4. Update available copies ”); printf(“5. Delete a book ”); printf(“6. Exit ”);printf(“Enter your choice: “); scanf(“%d”, &choice);switch (choice) { case 1: addBook(library, &bookCount); break; case 2: displayBookByISBN(library, bookCount); break; case 3: displayAllBooks(library, bookCount); break; case 4: updateAvailableCopies(library, bookCount); break; case 5: deleteBook(library, &bookCount); break; case 6: free(library); printf(“Goodbye! ”); return 0; default printf(“Invalid choice. Please enter a valid option. ”); }return 0;Sample Run: Welcome to the Library Book Record System!1. Add a new book 2. Display book details by ISBN 3. Display all books 4. Update available copies 5. Delete a book 6. Exit Enter your choice: 1 Enter book title: xyz Enter author: bbb Enter ISBN: 9780316769 Enter year of publication: 1950 Enter total copies: 3Enter available copies: 3 Book added successfully!Enter your choice: 2 Enter ISBN to search: 9780316769 Book details: Title: xyz Author: bbb ISBN: 9780316769 Year of publication: 1950 Total copies: 3 Available copies: 3Enter your choice: 3List of all books:1. Title: xyz Author: bbb ISBN: 978031679 Year of publication: 1950 Total copies: 3 Available copies: 3Enter your choice: 4 Enter ISBN to update available copies: 9780316769 Enter year available copies: 2 Available copies updated successfully!Enter your choice: 5 Enter ISBN to delete: 9780316769 Book deleted successfully!Enter your choice: 3List of all books: (no books left)Enter your choice: 6 Goodbye!To submit your makefile and C files on Moodle:1. Create a folder with your last name. 2. Place your c file(s), header file(s) and makefile inside the folder. 3. Zip the folder. 4. Upload it into Moodle.

$25.00 View

[SOLVED] Assignment 4 csc250

The objective of this assignment is to help students understand the significance of the argv array in C programming and practice working with two-dimensional arrays to mimic command-line arguments when argv is not available. Therefore, you will create a C program that simulates the behavior of command-line arguments without using the argv array. Instead, you will use a two-dimensional character array to accept and process command-line inputs.Requirements:1. Use a two-dimensional character array to store and process command-line arguments. You should define the array as follows: char args[argc][length], where argc is the maximum number of arguments your program can accept, and length is the maximum length of an individual argument.2. Implement a function called parseCommandLine that takes user input as a string and populates the args array. The user input should be entered as a single string with space-separated arguments.3. The program should print the number of arguments and the list of arguments.4. Use proper error handling. If the number of arguments provided exceeds the capacity of the args array, print an error message and terminate the program.Sample Run:$ ./HW4 Enter command-line arguments: ls -l -a Number of arguments: 3 Argument 0: ls Argument 1: -l Argument 2: -a

$25.00 View

[SOLVED] Assignment 5 csc250

Write a program that determines if two strings (words) are anagrams. The function (anagrams) should not be case-sensitive and should disregard any punctuation or spaces. Two strings are anagrams if the letters can be rearranged to form each other. For example, “state” is an anagram of “taste.” Each string contains one “s,” two “t’s,” etc. Test your function with several words that are anagrams and non-anagrams.You must write the corresponding anagrams c file for the following anagrams.h file: int anagrams (char str[], char strstr[]);Your anagrams.c file must also work with the following main.c file: #include #include // for exit(1) #include “anagrams.h”int main(int args, char *argv[]) { if (args == 3) { int ans = anagrams(argv[1], argv[2]); if (ans) // anagrams { printf(“%s is an anagram of %s”, argv[1], argv[2]); } else { printf(“%s and %s are not anagram of each other”, argv[1], argv[2]); } } // end ifelse { printf(“usage: ./a.out string1 string2 ”); exit(1); } return 0;—Requirements:– You are NOT allowed to use any predefined C function (string.h functions). – You must write an appropriate MakefileTo submit your PDF and Java files on Moodle:1. Create a folder with your last name. 2. Place your c file(s), header file(s) and makefile inside the folder. 3. Zip the folder. 4. Upload it to Moodle.Sample Run:./a.out State TasteState is an anagram of Taste./a.out state stat state and stat are not anagram of each other

$25.00 View

[SOLVED] Csc160 assignment 2

Write a Fraction class that implements these methods:Provide a driver class (FractionDemo) that demonstrates this Fraction class. The driver class should contain this main method:

$25.00 View

[SOLVED] Csc150 assignment 2

Write a Java program to calculate the profit of the East Coast division of a company based on a given percentage of total sales.Instructions:To start the assignment:Provided code template:Sample session: “The East Coast division will generate $23200000 if the company makes $40000000 in sales this year (62%).”Notes:

$25.00 View

[SOLVED] Csc150 assignment 4

The following rules illustrate traditional economic policy theory in terms of regulating a government’s economy.a) If the annual growth rate is less than 1%b) If the annual growth rate is greater than 4%Otherwise: No change in economic policy rate.

$25.00 View