A1. Find the output of the following code in order.
Q: Write a program that calculates the future value of an investment at a Final Exam Fall2014 given…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write the output: c) Void main() { int m[2]; int *p=m; m[0]=100; m[1]=200; printf(“%d %d",++*p,*p);…
A: Output of the given program is 101 100 ++*p in this p is pointed to m first,then incrememt
Q: A Create a column vector that has the following elements: In 292, 0.00552, In²29, and 133. 32 3.225…
A: We create the column vector by listing the elements inbetween [and], divided by a semicolon. For the…
Q: Q3. Write a python code to do the following operations. 1. Create a stress tensor and a strain…
A: Below I have provided the answer based on the Python Programming. Refer the comments for better…
Q: Given a text file containing the availability of food items, write a program that reads the…
A: I have provided PYTHON CODE , TXT FILE screenshot, CODE SCREENSHOT and OUTPUT…
Q: + main() + sum(int, int): int a. Public b. Protected c. Default d. Private 2. What is the return…
A: Access specifier Private: The access level of a class that is defined as private is only within…
Q: Use nested For-loop to produce the following output. Please enter an integer between (2 and 20) : 6…
A: Start input number of rows rows = n print n run two for loop two print this triangle stop
Q: Write a C function which takes a positive integer from the user and calculates the sum up to the…
A: Program description : The objective of the program,main.c to prompt the user to enter the value for…
Q: Write a function that takes the line number as a parameter and prints a number triangle and pattern…
A: #include<stdio.h> void pattern(int n) // user define function to draw the…
Q: Given a Series that stores the area of some states in km². Write code to find out the biggest and…
A:
Q: Which of the following commands can be used to read the entire contents of a file as a string using…
A: Python has three different methods to read the data from the objects. The following are the…
Q: What is the output of the following code fragment: int ar[]= (2, 4, 6, 8}; printf("%d",ar[1]);
A: The output is 4.
Q: 5.a. What are the advantage of function call-by -* reference over call-by-value? How would you pass…
A: Advantages of function call by reference over call by value in c: Function that change values of…
Q: You are given a graph with N nodes and M edges. Each edge has a value associated with it. There are…
A: Explanation: Here the path 1−>2−>3 has cost 4 while path 1−>4−>3 has cost 3 therefore…
Q: Pleas help me to solve this sample code Please help me to solve this I post this three-time and no…
A: Program: with Ada.Text_IO; procedure jDoodle is--jDoodle is the main subprogram…
Q: Create a program which validates whether a given array alternates between positive and negative…
A: C program to solve the given problem
Q: GENERAL ENGINEERING Perform the following data structure on Sorting: BASIC PROGRAMMING CREATE an…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: Make a menu that will display 10 names of countries. Let the user choose a country then display the…
A: 1) Below is program to display menu of 10 country names, let user select country then display…
Q: b) Write a recursive program to raise number X to power ni.e X".
A: EXPLANATIONS :- Coding is done in C Programming language. I have implemented a recursive method for…
Q: Trace the program below to determine what the value of each variable will be at the end after all…
A: Program Explanation: Header files are included to get standard input and output. The namespace is…
Q: 5. Write down complete Java statements to create a Frame with the following specifications. Frame…
A: The program in java is: import java.awt.*; import java.awt.event.*; public class Main {…
Q: 2.b. What are control statements? Explain all looping statements in C with examples.
A: What are control statements? Explain all looping statements in C with examples.
Q: Starting with your solution to the previous task, extend the Circle class by implementing the_eq__()…
A: Python Program: class Circle: def __init__(self,radius): self.radius=radius…
Q: 3.5 Write a program that reads five (5) numbers and stores it to an array named number; then…
A: Given: C programming
Q: 27, 58, 29, 40, 90, 78, 62, 30, 40, 56, 73, 31, 90, 25, 47 What are the five number summary listing…
A: Task :- five number summary for the given list of numbers. Five summary - 1. Minimum 2. Q1 (First…
Q: Quick assignment: Lists For this assignment, you must create and make use of lists and master the…
A: Language used is Python. Given problem can be done using the concept of lists in python.
Q: Suppose there is a file a.txt and contains three names in it. Kareem Rahman
A: Please find the answer below :
Q: Design a BASIC program to sort 50 random numbers by a method known as radix sorting. This method…
A: I have answered this question in step 2 & 3.
Q: Define a function named get_sum_string_lengths (a_linked_list) which takes a linked list as a…
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: 1. What is the output of this command 30:2:40
A: The given command follows the syntax a:n:b, which gives an array of equally spaced elements between…
Q: Complete the following table with appropriate values. String Expression…
A: compareTo() method: It is used to compare the two strings lexicographically. It compares two…
Q: List different String handling functions in C. Write a program to check whether the given string is…
A: Different String handling functions in C 1. strcat(s,t) : concatenate t at the end of s 2.…
Q: Write a function is stylish (shirt_colour, pants_colour) that takes the colours for shirt and pants…
A: Below I have provided a python program for the given question. Also, I have attached a screenshot of…
Q: base schema. In many enterprises there are multiple applications using the database; when v nge the…
A: It is defined as a systematic collection of data. They support electronic storage and manipulation…
Q: (d) Discuss the internal and external stability of the system.
A: A system is said to be stable, if its output is under control. Otherwise, it is said to be unstable.…
Q: Using methods and arrays, write a program that • Creates and fills an array A of size 50 filled with…
A: NOTE: Since programming language is not mentioned. Therefore answering the question in Python…
Q: 4.b. Write a user defined function to find the sum of elements of m*n matrix and finally returns the…
A: The program is written in C #include <stdio.h>int m,n,i,j;int sum(int a[m][n]){ int s=0;…
Step by step
Solved in 2 steps with 1 images
- A1. Find the output of the following code in order. public class Faculty extends Employee { - public static void main(String) args) { new Faculty () ; System.out.println("Good Luck"); public Faculty () { System.out.println(" Faculty's no-arg constructor is invoked"); class Employee extends Person { public Employee () { System.out.println (" Employee's no-arg constructor is invoked"); class Person { public Person () { this ("Invoke Person's overloaded constructor"); System.out.println("Person's no-arg constructor is invoked"); public Person (String s) { System.out.println (s);5) Consider the following code. public class Test { public static void main(String[] args){ NClass nc = new NClass(); nc.t += 1; } } class NClass { public imt t; private NClass() {//Constructor www. } } a) The program has a compilation error because the NClass class has a private constructor which is not accessible within the Test class. b) The program does not compile because the parameter list of the main method is wrong. c) The program compiles, but has a run time error because t has no initial value. d) The program compiles and runs fine.Find the output of the following code in order.
- 2- Consider the following program:public class Product{ private int price;public void setPrice(int theprice){price = thePrice;}}public class SpecialProduct extends Item{ private int discount;public void setDiscount(int theDiscount){discount = theDiscount;}}public class Main{public static void main(String[]args){SpecialProduct product = new SpecialProduct();}}Which of the following compiles without a problem? Why?a. product.discount = 20;b. product.setDiscount(20);c. product.setPrice(50);1%V1 l 3G 50 Write the code in main to call function tostring(): package lab5; public class Lab5 { public static void main(String] args){ ) } class person{ private String name; public String getname(){ return name;} public void setname(String n){ name=n; } } class Employee extends person{ private int Employeeld; public int getEmployeeld(){return Employeeld;} public void setEmployeeld(int employeeld){ this.Employeeld=Employeeld; }} class faculty extends Employee{ private String rank; faculty(int Employeeld,String name,String rank) { super.setEmployeeld(Employeeld); super.setname(name); this.rank=rank; public String tosring({ return super.getname()+" "+super.getEmployeeld()+" "+this.rank; 88 التفاف النص أدوات لوحة المفاتيح1) Draw a class diagram depicting the below code. class Doctor { void Doctor Details () { System.out.println("Doctor Details..."); } class Surgeon extends Doctor { void Surgeon_Details () { System.out.println("Surgen Detail..."); } } public class Hospital { public static void main(String args[]) { Surgeon s = new Surgeon (); } } } 2) Establish an association between Person class and Book Class given below. public class Person { } s. Doctor Details (); s. Surgeon Details (); } private String name; private int age; public Person (String initialName) { this.name = initialName; this.age = 0; } public void printPerson() { } public String getName() { return this.name; } System.out.println(this.name + age public class Book { private String name; private String publisher; private ArrayList authors; // constructor public ArrayList getAuthors() { return this.authors; } public void addAuthor (Person author) { this.authors.add(author); } + this.age + 11 years");
- Nutritional information (classes/constructors) PYTHON ONLY Complete the FoodItem class by adding a constructor to initialize a food item. The constructor should initialize the name (a string) to "None" and all other instance attributes to 0.0 by default. If the constructor is called with a food name, grams of fat, grams of carbohydrates, and grams of protein, the constructor should assign each instance attribute with the appropriate parameter value. The given program accepts as input a food item name, fat, carbs, and protein and the number of servings. The program creates a food item using the constructor parameters' default values and a food item using the input values. The program outputs the nutritional information and calories per serving for both food items. Ex: If the input is: M&M's10.034.02.01.0 where M&M's is the food name, 10.0 is the grams of fat, 34.0 is the grams of carbohydrates, 2.0 is the grams of protein, and 1.0 is the number of servings, the output is:…Instructions-Java Assignment is to define a class named Address. The Address class will have three private instance variables: an int named street_number a String named street_name and a String named state. Write three constructors for the Address class: an empty constructor (no input parameters) that initializes the three instance variables with default values of your choice, a constructor that takes the street values as input but defaults the state to "Arizona", and a constructor that takes all three pieces of information as input Next create a driver class named Main.java. Put public static void main here and test out your class by creating three instances of Address, one using each of the constructors. You can choose the particular address values that are used. I recommend you make them up and do not use actual addresses. Run your code to make sure it works. Next add the following public methods to the Address class and test them from main as you go: Write getters and…Take a look at the class declaration below: package p1; class Test8{ package p2; import p1.Test8; package p3; import p1.Test8; import p2.Test9; int i; class Test9 extends Test8 { private int j; protected int k; public int I; } class TestDemo3{ public static void main(String args[]){ Test8 t8 = new Test8(); Test9 t9 = new Test9(); } Out of these 4 variables declared in Test8, which are accessible in Test9 directly and by creating Test8 reference? In TestDemo3 main function, which variables can be used by each of the references t8 and t9?
- Number 8class overload { int x; double y; void add(int a , int b) { x = a + b; } void add(double c , double d) { y = c + d; } overload() { this.x 0; %3D this.y = 0; } %3D } class Overload_methods { public static void main(String args[]) { overload obj int a = 2; double b - 3.2; obj.add(a, a); obj.add(b, b); System.out.println(obj.x + } = new overload(); + obj.y); } #3Run the codepackage wednesdayClass; class Wuntumi{ private double salary; private String name; private float pension; } public class Sowh3 extends Wuntumi { public static void main(String footbal[]) { Wuntumi sobolo = new Wuntumi(); } } d. Explain why the code was incorrect.