i need life cycle and comments on these codes
(example: int x; // declare x ; )
VB Code
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Windows.Forms
Namespace Student
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub btnCalculatePerc_Click(ByVal sender As Object, ByVal e As EventArgs)
txtPercentage.Text = ((Convert.ToInt32(txtMark1.Text) + Convert.ToInt32(txtMark2.Text) + Convert.ToInt32(txtMark3.Text)) / 3).ToString()
End Sub
Private Sub btnDisplayGrade_Click(ByVal sender As Object, ByVal e As EventArgs)
If Convert.ToDouble(txtPercentage.Text) >= 80 Then
txtLevel.Text = "Excellent"
ElseIf Convert.ToDouble(txtPercentage.Text) >= 70 AndAlso Convert.ToDouble(txtPercentage.Text) <= 79 Then
txtLevel.Text = "Very Good"
ElseIf Convert.ToDouble(txtPercentage.Text) >= 60 AndAlso Convert.ToDouble(txtPercentage.Text) <= 69 Then
txtLevel.Text = "Good"
ElseIf Convert.ToDouble(txtPercentage.Text) >= 50 AndAlso Convert.ToDouble(txtPercentage.Text) <= 59 Then
txtLevel.Text = "Satisfactory"
ElseIf Convert.ToDouble(txtPercentage.Text) < 50 Then
txtLevel.Text = "Fail"
End If
End Sub
End Class
End Namespace
Step by stepSolved in 2 steps
- source code: import java.util.*;import java.io.*; public class Main { static File text = new File("/Users/.../Desktop/sourceCode.txt"); static FileInputStream keyboard; static int charClass; static char lexeme[] = new char[100]; //stores char of lexemes static char nextChar; static int lexLen;// length of lexeme static int token; static int nextToken; // Token numbers static final int LETTER = 0; static final int DIGIT = 1; static final int UNKNOWN = 99; static final int INT_LIT = 10; static final int IDENT = 11; static final int ASSIGN_OP = 20; static final int ADD_OP = 21; static final int SUB_OP = 22; static final int MULT_OP = 23; static final int DIV_OP = 24; static final int LEFT_PAREN = 25; static final int RIGHT_PAREN = 26; public static void main(String[] args) { try{ keyboard = new FileInputStream(text); getChar(); do { lex(); }while…arrow_forwardPlease fill in all the code gaps if possible: (java) public class LinkedListNode { private Object date; private LinkedListNode next; // Constructor: public LinkedListNode (Object data) // You also need to define the getter and setter: public LinkedListNode getNext() public void setNext (LinkedListNode next) public Object getData() public void setData(Object data) }arrow_forward2. Team Class a. Variables i. Trainer -> String Gym - >String Members ->arrayList of type pokemon iv. ii. ii. saveFile ->a constant string that is the filename of "teamData.record" b. Methods i. Accessor and Mutator methods for all variables ii. setTeam - >sets all variables for a team ii. 2 Constructors addMember 1. Add a pokemon to the members arraylist 2. readlnput for such pokemon V. saveData 1. Writes all data from this class to the binary file saveFile vi. loadData 1. Loads data from saveFile 2. Set the team using the setTeam method vii. writeOutput 1. Prints all data for a team including printing all data for each pokemon in the members arraylist 2. Before printing pokemon data, ensure that you use Collections.sort(members) on the members arrayList. You can look up how this method works, but it should use the compareTo that we set up in the pokemon class and sort the pokemon into alphabetical order before printing.arrow_forward
- Explain the functionality of each line of code in the following C# script- using System.Collections;using System.Collections.Generic;using UnityEngine; public class Movement2D : MonoBehaviour{ public float moveSpeed = 3f; public float jumpForce = 5f; public bool isGrounded; private bool doubleJump; private bool canDash = true; private bool isDashing; private float dashingPower = 24f; private float dashingTime = .2f; private float dashingCooldown = 1f; private bool isWallJumping; private float wallJumpingDirection; private float wallJumpingTime; private float wallJumpingCounter; private float wallJumpingDuration = .04f; private Vector2 wallJumpingPower = new Vector2(8f, 16f); [SerializeField] private Rigidbody2D rb; [SerializeField] private TrailRenderer tr; [SerializeField] private Transform wallCheck; [SerializeField] private LayerMask wallLayer; private SpriteRenderer sprite; public void Start() { sprite =…arrow_forwardPython, do not import any modulearrow_forwardComplete the Course class by implementing the courseSize() method, which returns the total number of students in the course. Given classes: Class LabProgram contains the main method for testing the program. Class Course represents a course, which contains an ArrayList of Student objects as a course roster. (Type your code in here.) Class Student represents a classroom student, which has three fields: first name, last name, and GPA. Ex. For the following students: Henry Bendel 3.6 Johnny Min 2.9 the output is: Course size: 2 public class LabProgram { public static void main (String [] args) { Course course = new Course(); // Example students for testing course.addStudent(new Student("Henry", "Bendel", 3.6)); course.addStudent(new Student("Johnny", "Min", 2.9)); System.out.println("Course size: " + course.courseSize()); } } public class Student { private String first; // first name private String last; // last name private…arrow_forward
- The two classes you will create will implement the operations defined in the interface as shown in the UML class diagram above. In addition, BinarySearchArray will implement a static method testBinarySearchArray() that populates the lists, and lets the user interactively test the two classes by adding and removing elements. The parameter BinarySearch can represent either class and tells testBinarySearchArray which class to test. Steps to Implement: 1) To get started create a new project in IntelliJ called BinarySearch. Add a class to your project called BinarySearchArray. Then add another class BinarySearchArrayList and an interface called BinarySearch. The interface BinarySearch includes public method stubs as shown in the diagram. You are allowed to add BinarySearchArrayList to the same file as BinarySearch but don't add an access modifier to this class, or for easier reading, you can declare the classes in separate files with public access modifiers. Only the class…arrow_forwardWrite Java code Objectives •Use an abstract data type for a list •Use a method that contains an Object type as a formal parameter •Use methods in an existing class •Access data members within a class Required Files: •ListInterface.java •ListException.java •ListOutOfBoundsException.java •ListArrayBased.java Description A list is an abstract data type used to store ordered data, and contains operations that fall into the following categories: (1) add data to a data collection, (2) remove data from a data collection, and (3) ask questions about data in a data collection. The operations which ask questions about the data in a data collection may include operations that determine if a data collection is empty, determine the size of a data collection, and retrieve the item at a given position in a data collection. A list should be able to contain any type of object. The methods for the List support any object as specified in the interface. In this assignment, the objects will be S trings.…arrow_forwardpython: def pokehelp(poke_name, stat_min): """ Question 4 - API You are looking for a Pokemon that can help you with your programming homework. Since Porygon is made of code, you decide to look into the species. Using the given API, return a dictionary that returns the name of each of Porygon's stats with a base stat GREATER THAN the given number, mapped to their value. Do not hardcode Porygon's stats into the results! It is not the only test case. Base URL: https://pokeapi.co/ Endpoint: api/v2/pokemon/{poke_name} Args: Pokemon name (str), stat minimum (int) Returns: Dictonary of stats >>> pokehelp("porygon", 65) {'defense': 70, 'special-attack': 85, 'special-defense': 75} >>> pokehelp("koraidon", 100) {'attack': 135, 'defense': 115, 'speed': 135} """ # pprint(pokehelp("porygon", 65)) # pprint(pokehelp("koraidon", 100))arrow_forward
- //asking this question again as the answer I was provided did not appear to follow the instructions of the question below Write a Java program that implements both Linear Search and Binary Search. The program willtake a collection of objects (generic type data) as input and print the number of comparisons neededto find a target element within that collection.You will create the following two Java classes: 1. SearchCombo.java : Code for both linearSearch and binarySearch will be in this class. Youmay take help from the textbook Chapter 9, Section 9.1. However, note that the design require-ments are different from the textbook code.•Both search methods must use the Comparable<T> interface and the compareTo() method.•Your program must be able to handle different data types, i.e., use generics.•For binarySearch, if you decide to use a midpoint computation formula that is different fromthe textbook, explain that formula briefly as a comment within your code. 2.…arrow_forwardYou have to use comment function to describe what each line does import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class PreferenceData { private final List<Student> students; private final List<Project> projects; private int[][] preferences; private static enum ReadState { STUDENT_MODE, PROJECT_MODE, PREFERENCE_MODE, UNKNOWN; }; public PreferenceData() { super(); this.students = new ArrayList<Student>(); this.projects = new ArrayList<Project>(); } public void addStudent(Student s) { this.students.add(s); } public void addStudent(String s) { this.addStudent(Student.createStudent(s)); } public void addProject(Project p) { this.projects.add(p); } public void addProject(String p) { this.addProject(Project.createProject(p)); } public void createPreferenceMatrix() { this.preferences = new…arrow_forwardpackage Q2;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.util.ArrayList;import java.util.Scanner;public class Question2 {public static void main(String[] args) throws FileNotFoundException {/*** Part a* Finish creating an ArrayList called NameList that stores the names in the file Names.txt.*/ArrayList<String> NameList;/*** Part b* Replace null on the right-hand-side of the declaration of the FileInputStream object named inputStream* so that it is initialized correctly to the Names.txt file located in the folder specified in the question description*/FileInputStream inputStream = null;Scanner scnr = new Scanner(inputStream); //Do not modify this line of code/*** Part c* Using a loop and the Scanner object provided, read the names from Names.txt* and store them in NameList created in Part a.*//*** Part d* Reorder the names in the ArrayList so that they appear in reverse alphabetical order.*/// System.out.println("NameList after correct ordering: "…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY