#Write a program in C to get the largest element of an array using the function
Explore tagged Tumblr posts
Text
program in C to get the largest element of an array
program in C to get the largest element of an array

Problem Statement: Write a program in C to get the largest element of an array using the function. c program largest element Test Cases: Input the number of elements to be stored in the array :10 Input 10 elements in the array : element – 0 : 1 element – 1 : 2 element – 2 : 3 element – 3 : 4 element – 4 : 5 element – 5 : 6 element – 6 : 7 element – 7 : 8 element – 8 : 9 element – 9 : 10…
View On WordPress
#c program#C#ctutorial#learn c#let us C#program in C to get the largest element of an array#Write a program in C to get the largest element of an array using the function
0 notes
Text
Visual Basic Programming Assignment Help
Visual Basic Allocation Help
We are the best providers of Visual Basic course assistance that help students improve their grades by delivering quality visual basic tasks, homework, and projects. So far, our experts have performed more than 3400 Visual Basic tasks. We have an 85% recursive customer rate, which clearly proves the equality of the brand that we are providing in the allocation of the program. We promise to deliver a high-quality solution within the deadline for all orders, making us the largest online allocation assistant. Our visual basic assignment help experts are available 24/7 to provide A-grade solutions to students. We really are the most sought-after service among students. Before we talk about our services, we learn a few concepts of Visual Basics.
Overview of Visual Basic for Applications (VBA)
Visual Basic is the third generation of programming language and integrated development environment, first developed by Microsoft. This language is developed from BASIC, which will enable web developers to build webpages using predefined tools, in addition to providing Rapid Application Development (RAD) with an attractive graphical user interface. This is a simple but interesting language that won't have complicated codes, and developers can pull and drop controls that are already defined. This is known as object-oriented programming language, which today teames up with .NET and calls it VisualBasic.NET. Visual basics are briefly referred to as VBA. This is a widely used programming language to develop software, application files, and ActiveKs control files. As with other programming languages, students completing computer science should work on Visual Basic tasks. Several elements that make this programming work include:
Structure of choice and repetition: Similar to other programming languages, loops and structures are important for deeper learning about the VBA. If / else i if / else / then there are several elements used in the selection structure.
Variables and Constants: Used to save different values. The variable values will change with the execution level, while the values associated with the constants will remain the same.
Operators and expressions: There is a wide range of operators that are used. Few include - <,>, < =,= =, < > yes, it is, it is not, etc.
Tools used for application design: VBA will offer you the tools you need to design apps and webpages without coding.
VBA deployments
Several popular VBA apps include:
Develop software and apps
Create files such as a .dll, .eke, and ActiveKs control
Design anything without coding and only by pulling and dropping features
You are dealing with a massive database, easy to manage DBMS with VB language and script
Visual Basic Application Features (VBA)
The key features of Visual Basic for Applications (VBA) are listed below:
It can be used to create software, applications, and databases
Compared to other programming languages, no or minimal coding is required
Coding is similar to coding on C and C + + and coding is easily understandable
There is no additional encoding because you have drag and drop features that perform all tasks
You can learn the basics of VBA from our Visual Basic task assistance experts.
Various topics for which our experts offer help to assign VBA
VB .Net themes:
The thread will enable the central processing to be divided into subprocesses, i.e. On two or more tasks performed in tandem. Threats are completely different from threats to processes. Basically, processes are fragments of a process. The process can also be initiated independently. When you develop an app that uses this programming language, amateur computer developers can create much or assume that the app will work efficiently. Few students will have difficulty fulfilling the task and will therefore struggle to achieve good grades. Send your task to us to take advantage of any help in visual basics.
Cloning objects:
Developers will clone projects to save time in executing projects. Cloning a data table is instead of creating one table from scratch, because you must first define new restrictions and then set the primary keys. All this is time-consuming. When objects are cloned in Visual Basics, developers can copy arrays of data while developing software. If you're a beginner on visual basis and don't have time to complete tasks, you can use our services to complete it with perfection. We have also experienced nimble helpers in Visual Basics who have extensive knowledge of different concepts of VBA for compiling tasks. Composed tasks can be used as teaching materials.
Socket:
Socket will promote efficient communication between customers and web servers that are connected to the same network. Socket will provide broad support for internet sharing in a computer network, as it acts as a point at which data is exchanged between the client and the web server software. For the server to communicate with the server on the client page, you should use the right port number. The challenge is for a computer student who is in the learning phase to create infinite loops that will allow you to assign the right port number to a network server. If you're having trouble writing tasks on sockers, you can seek help from our programming experts who are well aware of this theme.
Loop structures:
The loop will enable the software to perform multiple tasks over a specified period of time. The earnings calculation software will use the loop to post their employees' earnings into the account after every 30 days. There are many banks that will use time-block safes that will close without human intervention after bank hours. Loops will allow developers to run many code lines at the same time without having to type code lines again. If you find it difficult to work on a loop structure or don't have time to coding, then you can seek the help of our professional programmers to help with visual basics.
Data comparison and logical operators:
Comparing data will allow software developers to find similarities and differences between objects in the application source code. Logical operators use developers to sum up search results. For example, when you enter the best recipes for potatoes and tomatoes, you get the results of the best recipes for potatoes and tomatoes. Here, search engines use the "i" operator to extract results. Many developers will use logical operators to compare data when validating source code. This process takes up a lot of time. You can hire our Visual Basics project to help experts complete your task on this theme to perfection.
Why do students need Visual Basic homework help?
Visual Basic is simple, but for many students it can be confusing. Many students describe it as programming prone to error and difficult to read. Below are the reasons why students are speaking to us for help with homework from Visual Basics.
Various topics such as loop structure, constants, and variables, etc. They are extremely difficult for students to understand and apply in homework tasks
The Visual Basic task should be performed practically and tested. Students face difficulties in perceiving these notions due to a lack of practical knowledge.
Mathematics and logical operators are difficult to spot and therefore students face problems in carrying out tasks
Current Visual Basic Allocation Help
Many students face difficulties writing a Visual Basic task due to a lack of knowledge and practice regarding various practical concepts. That's why we started offering Visual Basic assistance for applications or VBA homework assistance to college students at affordable prices. Our developers will use their knowledge and experience to write VBA codes that are well commented on and easily executed. We have a team of programmers who have graduated from distinguished universities and have a base of industrial experience for code writing and theoretical work. Every task solved by our experts is well structured and tailored to the requirements.
Why are students choosing our help with visual basic task?
Students who are assigned to write a task on a complicated subject will face many questions. It takes them a long time to explore and express it in their own words. There are several challenges they face that would require professional help, which is offered to us. Several other benefits that students can take advantage of using our service include:
Professional developers: Our team of Visual Basic Assignment help developers has more than 15 years of experience in writing and programming and providing quality documents has helped thousands of students worldwide. All our experts are highly knowledgeable about visual basics.
24/7 Technical support: A student would be frustrated if the answer to his query is not answered harshly and the grades depend on the answers they receive. However, you no longer have to worry about hiring, because we have a technical team that responds to your queuing in an instant.
Meet the deadline: No matter how complex the subject of the task or code to be drafted, we offer a solution without crossing the deadline.
Ask for help assigning VBA class code + just by ordering on our website.
0 notes
Text
ASSIGNMENT 4 COMP-202 Solved
Please read the entire PDF before starting. You must do this assignment individually. Question 1: 15 points Question 2: 45 points Question 2: 40 points 100 points total It is very important that you follow the directions as closely as possible. The directions, while perhaps tedious, are designed to make it as easy as possible for the TAs to mark the assignments by letting them run your assignment, in some cases through automated tests. While these tests will never be used to determine your entire grade, they speed up the process significantly, which allows the TAs to provide better feedback and not waste time on administrative details. Plus, if the TA is in a good mood while he or she is grading, then that increases the chance of them giving out partial marks. :) Up to 30% can be removed for bad indentation of your code as well as omitting comments, coding structure, or missing files. Marks will be removed as well if the class and method names are not respected. To get full marks, you must: Follow all directions below Make sure that your code compiles Non-compiling code will receive a very low mark Write your name and student name is written as a comment in all .java files you hand in Indent your code properly Name your variables appropriately The purpose of each variable should be obvious from the name Comment your work A comment every line is not needed, but there should be enough comments to fully understand your program 1
Part 1 (0 points): Warm-up
Do NOT submit this part, as it will not be graded. However, doing these exercises might help you to do the second part of the assignment, which will be graded. If you have difficulties with the questions of Part 1, then we suggest that you consult the TAs during their office hours; they can help you and work with you through the warm-up questions. You are responsible for knowing all of the material in these questions. Warm-up Question 1 (0 points) Write a method longestSubArray that takes as input an array of integer arrays (i.e. a multi-dimensional array) and returns the length of the longest sub-array. For example, if the input is: int arr= {{1,2,1},{8,6}}; then longestSubArray should return 3. Warm-up Question 2 (0 points) Write a method subArraySame that takes as input an array of integer arrays (i.e. a multi-dimensional array) and checks if all of the numbers in each ‘sub-array’ are the same. For example, if the input is: int arr= {{1,1,1},{6,6}}; then subArraySame should return true and if the input is: int arr= {{1,6,1},{6,6}}; then subArraySame should return false. Warm-up Question 3 (0 points) Write a method largestAverage that takes as input an array of double arrays (i.e. a multi-dimensional array) and returns the double array with the largest average value. For example, if the input is: double arr= {{1.5,2.3,5.7},{12.5,-50.25}}; then largestAverage should return the array {1.5,2.3,5.7} (as the average value is 3.17). Warm-up Question 4 (0 points) Write a class describing a Cat object. A cat has the following attributes: a name (String), a breed (String), an age (int) and a mood (String). The mood of a cat can be one of the following: sleepy, hungry, angry, happy, crazy. The cat constructor takes as input a String and sets that value to be the breed. The Cat class also contains a method called talk(). This method takes no input and returns nothing. Depending on the mood of the cat, it prints something different. If the cat’s mood is sleepy, it prints meow. If the mood is hungry, it prints RAWR!. If the cat is angry, it prints hsssss. If the cat is happy it prints purrrr. If the cat is crazy, it prints a String of 10 gibberish characters (e.g. raseagafqa). The cat attributes are all private. Each one has a corresponding public method called getAttributeName() (ie: getName(), getMood(), etc.) which returns the value of the attribute. All but the breed also have a public method called setAttributeName() which takes as input a value of the type of the attribute and sets the attribute to that value. Be sure that only valid mood sets are permitted. (ie, a cat’s mood can only be one of five things). There is no setBreed() method because the breed of a cat is set at birth and cannot change. Test your class in another file which contains only a main method. Test all methods to make sure they work as expected. Warm-up Question 5 (0 points) Using the Cat type defined in the previous question, create a Cat of size 5. Create 5 Cat objects and put them all into the array. Then use a loop to have all the Cat objects meow. Warm-up Question 6 (0 points) Write a class Vector. A Vector should consist of three private properties of type double: x, y, and z. You should add to your class a constructor which takes as input 3 doubles. These doubles should be assigned to x, y, and z. You should then write methods getX(), getY(), getZ(), setX(), setY(), and setZ() which allow you to get and set the values of the vector. Should this method be static or non-static? Warm-up Question 7 (0 points) Add to your Vector class a method calculateMagnitude which returns a double representing the magnitude of the vector. Should this method be static or non-static? The magnitude can be computed by taking: magnitude = px2 + y2 + z2 Warm-up Question 8 (0 points) Write a method scalarMultiply which takes as input a double, and a double scale, and returns void. The method should modify the input array by multiplying each value in the array by scale. Should this method be static or non-static? Warm-up Question 9 (0 points) Write a method deleteElement which takes as input an int and an int target and deletes all occurrences of target from the array. By “delete” we mean create a new array (of smaller size) which has the same values as the old array but without any occurrences of target. The method should return the new int. Question to consider: Why is it that we have to return an array and can’t simply change the input parameter array like in the previous question? Should these methods be static or non-static? Warm-up Question 10 (0 points) Write the same method, except this time it should take as input a String and a String. What is different about this than the previous method? (Hint: Remember that String is a reference type.)
Part 2
The questions in this part of the assignment will be graded. Question 1: Exam Grading (15 points) For this question, you will use multi-dimensional arrays to write a program that grades a multiple choice exam. Your code for this question should go in a file ExamGrading.java We strongly recommend that you complete the first three warm-up questions before starting this problem. Write a method gradeAllStudents that takes as input a two dimensional char array containing student responses to a multiple choice exam, and a one dimensional char array containing the solutions to each question. Each element in the 2d array is an array representing one student’s responses to the entire exam. This method returns a double representing the grades for each student as percentages. Assume that all questions are worth 1 point. You may also assume that all char values are upper-case letters, and valid exam responses. If, at any point, the number of responses for a student does not match the number of questions on the exam (the number of solutions), your method should throw an IllegalArgumentException that contains a message letting the user know which student (by index) caused the error, as well as what the two conflicting lengths were. Below is an example. Suppose we have a multiple choice exam with 6 questions and written by 4 students: char responses = {{‘C’, ‘A’, ‘B’, ‘B’, ‘C’, ‘A’}, {‘A’, ‘A’, ‘B’, ‘B’, ‘B’, ‘B’},
{‘C’, ‘B’, ‘A’, ‘B’, ‘C’, ‘A’}, {‘A’, ‘B’, ‘A’, ‘B’, ‘B’, ‘B’}};
char solutions = {‘C’, ‘A’, ‘B’, ‘B’, ‘C’, ‘C’}; The output of gradeAllStudents would look like: Question 2: Cheating in Exams (45 points) For this question, you will again use multi-dimensional arrays, and you will write several methods to build a program that flags students for potential cheating on multiple choice exams. Your code for this question should go in the same file as the previous question: ExamGrading.java Write a method numWrongSimilar that takes as input two char arrays representing the answers of two different students, as well as a char array of solutions. This method returns the number of wrong answers that the students had the same. This method should throw an IllegalArgumentException if the students have responses that differ in length from each-other, or from the solutions. For example, suppose the answer arrays are: {‘A’,‘B’,‘C’,‘D’,‘C’,‘A’} {‘A’,‘B’,‘D’,‘B’,‘B’,‘A’} and the solutions are: {‘C’,‘B’,‘C’,‘D’,‘A’,‘A’} Then the method would return 1, since the only question where they both put the same wrong answer is the first one. Write a method numMatches that takes as input a char representing all students’ responses, a char representing the solutions, an int representing the index of a particular student, and another int representing the similarity threshold (minimum number of wrong answers that have to be the same in order for it to be flagged as suspicious). This method compares the answers of the student at index with all other students. We will obtain the number of students who share wrong answers by repeatedly calling the numWrongSimilar method. However, only those students with a number of shared wrong answers greater than or equal to the similarity threshold will be counted. The method returns the number of students whose wrong answers are too similar to those of student index. You must use the numWrongSimilar method that you wrote previously in writing this method. For example, suppose we have the following three student responses (we have named the students for clarity in the example. You are not expected to name your students): {‘A’,‘B’,‘C’,‘D’,‘B’,‘A’} (Student 0: Samwise) {‘C’,‘B’,‘D’,‘D’,‘B’,‘B’} (Student 1: Frodo) {‘C’,‘B’,‘D’,‘D’,‘C’,‘B’} (Student 2: Gandalf) and the solutions are: {‘C’,‘B’,‘C’,‘D’,‘A’,‘A’} If we call the method with index 1 and similarity threshold 2, the method would compare the number of incorrect responses that Frodo shares with Samwise (one), and the number of incorrect responses that Frodo shares with Gandalf (two). Since the similarity threshold is 2, we would return 1, since there is only one student (Gandalf) who has at least similarity threshold wrong answers as Frodo. (c) Finally, write a method findSimilarAnswers that takes as input three things: An int representing the minimum number of answers that need to be flagged in order to count as suspiciously similar. A char representing the responses of all students. A char representing the solutions. This method returns an int where each index represents a student, and each sub-array lists the indices of all students who have similar wrong answers to the student at that index. Note that this array might be jagged (not rectangular), but that it should be symmetric (if student 3 matches with student 7, then student 7 should match with student 3). In order to do this, you will need to use the numMatches method to determine the length of each sub-array. Then, you need to use the numWrongSimilar method to determine which student indices belong in that sub-array. Be careful not to match a student with themselves! Hint: In order to quickly display the contents of arrays, use the Arrays.toString and Arrays.deepToString methods. Below is an example. Suppose we have a multiple choice exam with 6 questions and written by 4 students: char responses = {{‘C’, ‘A’, ‘B’, ‘B’, ‘C’, ‘A’}, {‘A’, ‘A’, ‘B’, ‘B’, ‘B’, ‘B’},
{‘C’, ‘B’, ‘A’, ‘B’, ‘C’, ‘A’}, {‘A’, ‘B’, ‘A’, ‘B’, ‘B’, ‘B’}};
char solutions = {‘C’, ‘A’, ‘B’, ‘B’, ‘C’, ‘C’}; If we run findSimilarAnswers with a similarity threshold of 3, we would see: , , , ] Students 1 and 3 had at least half of their exams containing wrong answers that were the same (the first, last and second to last questions). If we run findSimilarAnswers with a similarity threshold of 5, we would see: , , , ] Since no pairs of students had at least 5 of their exam questions containing the same wrong answers. If we run findSimilarAnswers with a similarity threshold of 1, we would see: , , , ] Student 0 has only one wrong answer, and it is the same as one of student 2’s wrong answers. Student 1 and student 3 share three wrong answers. In addition to sharing one wrong answer with student 0, student 2 shares two wrong answers with student 3. Question 3: Wool Farming (40 points) For this question, you will write several classes, and then create and use instances of those classes in order to simulate a sheep farm. (7 points) Write a class Dog. A Dog has the following private attributes: A String name A String breed The dog class also contains the following public methods: A constructor that takes as input the name and breed of the dog getName which returns the name of the dog. A herd method that returns the number of sheep the dog can herd. This will depend on the type of dog doing the herding. All dogs of the Collie breed can herd 20 sheep, while all Shepherds can herd 25 sheep. Kelpies and Teruvens can each herd up to 30 sheep. All other breeds of dogs can herd 10 sheep. For example, a Dog of breed White Shepherd or belgian shepherd, or just shepherd would be able to herd 25 sheep. Hint: Think about you can use the toLowerCase() and contains() methods to do this check in a case-insensitive manner. (8 points) Write a class Sheep. A Sheep has the following private attributes: A String name An int age A boolean hasWool A static Random numberGenerator Initialize the Random numberGenerator with seed 123. The Sheep class should also have the following public methods: getName(): returns the name of a Sheep getAge(): returns the age of a Sheep A constructor that takes as input the name and age of a Sheep. It should set hasWool to be true shear(): This method returns a random double between 6 and 10 (inclusive), representing the amount of wool (in pounds) taken from the sheep. You can only shear a sheep if it presently hasWool. This method sets hasWool to false after a sheep is sheared. This method should return 0 if the sheep has no wool on it. Use the static Random numberGenerator and nextDouble in generating the random number. (Do not use Math.random()). Note that by using the Random class, you will get the same sequence of ‘random’ numbers every time you run your code. (15 points) Write a class Farm. This class has three private attributes: An array of Sheep A Dog A String name It also has the following public methods: A constructor that takes as input the name of the farm, a Dog who will be responsible for herding the sheep, and an array of sheep. It initializes the Sheep array and copies the Sheep references from the input array to the Farm array. Throw an IllegalArgumentException if there are more Sheep than the Dog can herd. getName that returns the name of the farm. getNumSheep that returns the number of sheep on the farm. printFarm that prints the name of the farm, the name of the dog on the farm, as well as the names and ages of all of the sheep. getWool it returns (in pounds) the amount of wool obtained from shearing all sheep on the farm. (10 points) In the provided class WoolFactory write a main method. Here, you will write a main method that creates a farm where the name of the farm, the name and breed of dog, and number of sheep are chosen by the user via a Scanner object. In order to facilitate generating your Sheep array, we have provided methods to generate random Sheep ages, and to select Sheep names randomly from a provided array of potential Sheep names (you are welcome to use your own names or modify this code). Then, shear all of the sheep on the farm. Display the number of sheep on the farm, and then use the printFarm() method to give them complete farm information, and then print how much money they made. Sheep’s wool sells for $1.45 per pound. Sample interaction and output is shown below:
What To Submit
You have to submit one zip file that contains all your files to myCourses - Assignment 4. If you do not know how to zip files, please enquire that information from any search engine or friends. Google might be your best friend with this, and for a lot of different little problems as well. These files should all be inside your zip. Do not submit any other files, especially .class files. WoolFactory.java Sheep.java Dog.java Farm.java ExamGrading.java Confession.txt (optional) In this file, you can tell the TA about any issues you ran into doing this assignment. If you point out an error that you know occurs in your problem, it may lead the TA to give you more partial credit. On the other hand, it also may lead the TA to notice something that otherwise they would not. Read the full article
0 notes