2. Determine the output from the following program.
Q: output of the following * ?program
A: According to the question we need to find the output for the 2 Programs:…
Q: Complete the following program by writing its functions:
A: We need to define the methods abs(),Prime(),Find(),Power() and Max() as per the given description.
Q: State which of the following are true and which are false. If false, explain why.a) Function fscanf…
A: True.
Q: How many lines of output will be displayed on the screen after the following program is executed?
A: In this question, we are asked to give the correct output of given below code: int main(){ int i…
Q: * Find the result of the following program
A: Define header files <iostream> and <iomanip> for io and manipulation of data operations.…
Q: What is the output of the following program? Explain why?
A: Program Explanation: Define a class for boy with the instance variable age having a default value…
Q: 3. Write a program which takes two integers and print their sum, subtraction, multiplication, and…
A: a program which takes two integers and print their sum, subtraction, multiplication and…
Q: Q/ Write a program to implement the below equation.
A: #include<iostream> using namespace std; int main(){ int n, k, y =…
Q: (7 What does this function do? SOURCE CODE 1. int T(int x, int y) 2. 3. int sum 0; 4. if (odd (x))…
A: C++ CODE #include <iostream>using namespace std;int T(int x,int y){ int sum=0;…
Q: Find the Error(s) in the following program and state how to fix those error(s).
A: As per the policy and guidelines of Bartleby we are supposed to answer only first question or the…
Q: What is the correct output from the following program?
A: Program: // Include Header file #include <iostream> using namespace std; // Main function int…
Q: Modify the following program so that it prints: SO |B is defined.
A: function defined(int arg): Start if arg == 1 then return true else return false Stop function…
Q: a. What is the output of the following code? And why?
A: The given is the java code that will produce the result based on inputs. To generate the output of…
Q: Find the output for the following program segment:
A: In step 2, I have provided OUTPUT ------------ In step 3, I have provided C CODE along with CODE…
Q: ld you please explain the following program with detai
A: include<stdio.h> standard input-output library. struct is the keyword and clientData is the…
Q: A: Specify the false on the following program:
A:
Q: What would be the output of the following program?
A: The given program is:- tt = ['c', 'o', 'r', 'k']tt = ['m', 'a', 'c', 'h', 'i', 'n', 'e'] + tttt[0] =…
Q: Compute the following and give the result in the space provided below: Consider the following…
A: lets analyze each of the given values, using c++ :- #include <iostream>using namespace std;…
Q: Which of the following is not accomplished with the print function?
A: LET US SEE THE ANSWER : The print() function outputs the message to the normal output device, such…
Q: /*Question: what is the output after executed the following Program*/
A: The output after executing the above program is as follows:
Q: What is the value of x and y after executing the following program?
A: The output will be: 15&10. Where x = 15 and y = 10
Q: Discuss in your own word the function and output of the two programs.
A: The question is on discussing in your own word the function and output of the two programs.
Q: Q2: Write a brief description to each line in the following programs, and determine the output of…
A: This program is for checking even odd number. int n; //here n is declared. printf("Enter a…
Q: write program to find the following using function
A: % compute function term exp2 = @(n) n^(n)/factorial((n+1)); % taking n as paramter exp1 = 9.8; %…
Q: 50- Find the output of the following program. main(){ int a, b = 10; a = 95 / 10; cout << a << endl;…
A: Given data: 50: main() { int a, b = 10; a = 95 / 10; cout << a << endl;} 2:…
Q: :Find the output ;int i = 1 while (i * i <= 10)
A: I have provided a solution with code and output as below.
Q: Find the result for the following program
A: The given code is written in the C++ programming language. The requirement is to find the result of…
Q: following statement:
A: Filled the given statement
Q: /*Question: what is the output after executed the following Program*/ #include
A: Required: I need the answer as soon as possible
Q: Describe what the following code is doing (the outcome), by annotating each line of code and giving…
A: The program starts by moving 100 in R0 and 20 in R1 In second line the loop starts: It compares…
Q: What would be the output of the following program
A: Given recursive implementation of hen with 1-9 having base case and more than that will be recursive…
Q: The output of the following program is :-
A: Output:
Q: What is the output of the following cod
A: Required: provide the output of the following code ?
Q: What is the function of the above programs
A: Given : AMM PROC CMP AX,97 JL DONE CMP AX,122 JG DONE SUB AX,32 DONE: RET AMM ENDP
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- public class Main{ public static void main(String args[]) { Main m = new Main(); m.go(); } public void go() { Customer c = new Customer("Tom", "Smith"); Order o = new Order(c); o.addItem(new Item("Greeting Card", 1.50, 1)); o.addItem(new Item("Baseball Glove", 54.00, 1)); o.addItem(new Item("Notebook", 2.50, 3)); System.out.println(o); }}class class { public static void main(String args[]) { int a =5; int b =10; first: { second: { third: { if(a == b >>1) break second; } System.out.println(a); } System.out.println(b); } } } Give result for the code Java Try to do ASAPpublic class SeperateDuplicates { public static void main(String[ args) { System.out.printIn(seperateDuplicatesChars("Hello")); System.out.printin(seperateDuplicatesChars ("Bookkeeper"')); System.out.printin(seperateDuplicatesChars("Yellowwood door"')); System.out.printin(seperateDuplicatesChars("Chicago Cubs")); */ public static String seperateDuplicatesChars(String str) { //To be completed } }
- class 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 codeclass Param3 { public int x; private void increase(int p) { x = x*p; } public void calculateX(int y) { increase(y); } public int getX() { return x; } } // in another class Param3 q3 = new Param3(); q3.x = 5; q3.calculateX(7); System.out.println(q3.getX()); what would be the answer for the last two lines ? also above were x = x*p do both x in here are the fields? wouldn't that be cnofusing?QUESTION 9 Public Class Employee { public static int y; Private int age; Public Employee(0{ age=0;} public int get_age() { return age;} Public Class Test { public static void main(String[] args) { Employee q = new Employee(); q.y=2; Employee.y=10; System.out.println("y=" + q.y); a. What is the output of the following code? b. Insert a System.out.println() statement that prints out q's age
- Computer Science Java Language: Provide the equivalent UML Diagram for this code. public class ClassTest { public static void main (String args[]) { TestB objB = new TestB(); TestB objC = new TestB(); Testers objA = new Testers(); objA.Display(); } }JAVA Language Caesar Shift Question: Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.) import java.util.*; public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…public class Test { } public static void main(String[] args){ int a = 10; System.out.println(a*a--); }
- public class sample{public static int x = 100;public static int y = 150; }public class newspaper :sample{new public static int x = 1000;static void Main(string[] args){console.writeline(sample.x + " " + sample.y + " " + x);}} 100 150 1000 1000 150 1000 100 150 1000 100 150 100public class Animal { public static int population; private int age; } public Animal (int age) { this.age = age; population++; } + msg); public void say (String msg) { System.out.print("Saying: " System.out.print(" for "); System.out.print(getHuman Years()); System.out.println(" years."); } public int getHuman Years() { return age; } public class Mammal extends Animal { private String species; public Mammal(String species, int age) { super (age); this. species species; } } } = public int getHuman Years() { if (species.equals("dog")) 1 else return super.getHumanYears() * 7; return super.getHumanYears(); €Case Diagram and UML Class Diagram for this java code : (Below the code give some constructive critiques about the UML class diagram)…. Thanks import java.util.*; public class BeverlyBreads{public static void main(String[] args){Scanner input = new Scanner(System.in); //Array for breads String[] breads = new String[5]; //Bread choices breads[0] = "White Bread"; breads[1] = "Wheat Bread"; breads[2] = "Rye Bread"; breads[3] = "Pumpernickel Bread"; breads[4] = "Baguette"; //Prices for the breads double[] prices = new double[5]; prices[0] = 2.99; prices[1] = 3.49; prices[2] = 3.99; prices[3] = 4.49; prices[4] = 4.99; //Customer's Name System.out.println("Enter customer's name: "); String name = input.nextLine(); //Customer's Phone Number System.out.println("Enter customer's phone number: "); String phoneNumber = input.nextLine(); //Bread Selection System.out.println("Which bread would you like to order?"); for(int i = 0; i < breads.length; i++) { System.out.println(breads[i] + "…