public class output{ public static int check (int a, int b, int c) { if(a==0) return (b); else if (a>b && a>c) return 1 + check (0,b-1,c-1); else return 2 + check(a-1,b-1,c-1); } public static void main (String[] args) { int R = check (3,2,1); System.out.println (R) ; } // end of class
Q: public class P1 { public static void main (String args[]) { int[] numbers = {2,4,10,11,14,28}; int…
A: Here in this question we have given a Java code segment and we have asked to find the output of this…
Q: - CPS150 GaussLab2.java Open with - import java.util.Scanner; * CPS150 GaussLab2.java ** / ★ CPS 150…
A:
Q: public class Test { public static void main(String[] args) { Number x = new Integer (3);…
A: //we are getting the error because X is an Number and new Integer is an integer so we are not able…
Q: public class Test { public static void main(String[] args) { int arr[] = {1,2,3,4,5}; int count = 0;…
A: The program is to double the even elements in an array.
Q: 2. public class Test2 { public static void main(String[] args) { for (int x=1; x < args.length; ++x)…
A: Given: public class Test2 { public static void main(String[] args) { for(int x=1;…
Q: public class output{ public static int find (int a1, int a2) if(al==0) return(al+1); else if(a1>0 &&…
A: Explanation:- 1. Initially both a1 and a2 value is 2. 2. Then the else condition will be hit for the…
Q: Write a Java program using a for loop or a while loop that reads a word and prints the word in…
A: Given: Write a Java program using a for loop or a while loop that reads a word and prints the word…
Q: public class DebugThree2 { public static void main(String args[]) int a = 2, b = 5, c = 10; add(a,…
A: Many syntax and logical errors may disturb our program and prevent us from achieving our output.…
Q: Write the method catDog
A: Programming approach Initialize the variables with 0 for keeping the count of the words “cat” and…
Q: public static void main (String [] args) { first: for( int i = 1; i < 5; i++) { second: for(int j =…
A: Flow chart: The flow chart shows the steps as boxes of different types and their order when the…
Q: class class { public static void main(String args[]) { int a =5; int b =10; first: { second: {…
A: Given, Programming Language = JAVA Code: class class { public static void main(String…
Q: public class output{ public static int find (int a1, int a2) { if(a1==0) return(a1+1); else if(a1>0…
A: There is a class output in which two method are there find and main. Find method is recursively…
Q: public class output[ public static void find (int [] arri,int [] arr2, int start) ( int x-0,y-0,-;…
A: Given Java program is a Iterative program which contains many for loops. It contains a output class…
Q: Write a program that takes a string and integer as input, and outputs a sentence using those items…
A: Please find the answer below
Q: ample Input: Text string: You will always have my love, my love, for the love I love is as lovely as…
A: import java.io.*;import java.util.Scanner; class Main { public static int countOccurrences(String…
Q: 1 public class Con{ public static void main(String[] args) 3- { int[] ar-{2,5,7,9}; 5 int i-2; final…
A: Error: cannot assign a value to final variable j
Q: modify the java program below to use try-catch logic to detect input errors and display an error…
A: Given code: import javax.swing.*; public class Main { public static void main(String[] args) {…
Q: Write a recursive method that displays a string reversely on the console using the following header:…
A: Reverse a String using recursion. The required Java program is implemented below. Recursion Logic :…
Q: Write a Java program that takes an integer as input, computes and displays the reverse of that…
A: According to the information given:- We have to takes an integer as input, computes and displays the…
Q: class Test { public static void main(String[] args) { for (int i = 0; 1; i++) {…
A: Given Java code : class Test { public static void main(String[] args) { for (int i = 0; 1; i++) {…
Q: public class Test { public static void main(String[] args) { int[][] array ={{ 8, 9, 10, 11 }, { 4,…
A: Explanation and logic Here we have two dimensional array which can be represent like this(In matrix…
Q: n Java trace the table for a while loop public class Main { public static void main(String[] args)…
A: According to the Question below the Solution:
Q: public static void main(String [] args) { int num1 = 5, num2 = 10; swap(num1, num2);…
A: Given: public static void main(String [] args){ int num1 = 5, num2 = 10; swap(num1, num2);…
Q: Complete the below code in such a way to produce output 2 public class Main public static void…
A: This is a JAVA langauge problem. In this question, we have to fill in the two blanks. So that the…
Q: public class FAT { public static void main(String args[]) {double i-3; int n-1003; do{ i-(i*1.5)-1%;…
A: The time complexity is mainly depends on the loops and the recursive functions present in the…
Q: Rewrite the code using "while Loop" instead of "for Loop". Output must remain the same. CODE:…
A: Java code for above using while loop: import java.util.*; public class Prog { public static…
Q: public static void find (int [] arr1, int [] arr2, int start)
A: Program: // JAVA Program// Class declarationpublic class output{ public static void find (int[]…
Q: public class output[ public static void main(String[] args) { int [][] D= new int [3][3]; int [] c =…
A: - We need to talk about the program and produce it's output.
Q: Complete this program to print a table of prices. The first column has width 8 and the second column…
A: A Java program for the given criteria is as follows, import java.util.Scanner; public class Table {…
Q: Write the output of the following String and Math Methods in java. public class mathestr { public…
A: Provide the output of given program.
Q: public class Test public static void main (String [] args) { System.out.println ("The average is " +…
A: returnValueType for the method average is "Double"
Q: Convert this PROGRAM CODE from Java to C++. import java.util.Scanner; public class…
A: Required: Convert the given PROGRAM CODE from Java to C++.
Q: What will be the output of below given program: class Main public static void main(String[] args) {…
A: Task :- Write the output for given Java code.
Q: Please add Algorithm and comments to my program. Thank you public class While { public static…
A: Below is the Complete Algorithm and Program Explanation:-
Q: public class MyClass { public static void main (String args []) { int x = 1; System.out.println(x) ;…
A: here I written given code with fully understand language with comments that how all value will…
Q: There are two problems. One line of code needs changed and the way I'm running the code needs…
A: There are two lines in the code that needs to be changed: Change int result = addValues(args); to…
Q: please answer correctly Algorithm Running Time package test; import java.util. *; import…
A: Answer arrow_forward Algorithm Running Time package test; import java.util.*; import…
Q: Write a recursive method that converts a positive decimal number to into a binary number as a…
A: A Java program for the given criteria is as follows,
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: The problem with your code is it can read only one line. As question says we have to read until user…
Q: w int[a.length]; for(int i = 0; i < a.length; i++) { for(int j = 0; j < b
A: explained as,
Q: import java.util.*; 2 usages public class Main public static void main(String[] args) { Scanner sc =…
A: - We have the problem for parsing the string. - Just copy the complete code and it will surely…
Q: Re-write this program using Iterators but without changing the meaning and consequently producing…
A: class TwoDArray { public static void main(String args[]) { int i, j, k = 0, twoD[][] = new…
Q: public class output{ public static void main(String [] args){ int [][] D int [] C = {0,0,1}; new int…
A: Output - 11 Stack Trace of outpur
Q: Solve all the errors in the below method of C# language step by step and comment the error by…
A: After removing all the errors the correct code is given below with proper comments as below:
Q: import javax.swing.JOptionPane; public class Addition { public static void main( String args[] ) {…
A: you are not calculating the sum in your code. you are just assigning the number to sum every time…
Q: public class P2 { public static void main(String[] args) { int[][] a2 = new int[3][3]; for (int i=0;…
A: According to the information given:- We have to compile this code and find out its output.
Q: The String class is provided in the Java library. Provide your own Java implementation for the…
A: Explanation: charAt() The charAt () function of the Java-String class produces the character…
Q: Write a recursive method called digitCount() that takes a positive integer as a parameter and…
A: According to the Question below the Solution: Output:
Q: Write a java program that takes a string as input from the user and finds out if the string is a…
A: import java.util.*; public class Main { public static void main(String args[]) { String a, b = “”;…
Step by step
Solved in 3 steps with 2 images
- Transcribed Image Text #include<stdio.h> #include<string.h> #include<conio.h> #include<stdlib.h> int i; char n=1,username[16],password[ 30],ch; void welcome() { system ("@cls||clear"); printf("\t\tWECOME TO MY SITE\n"); } int main() { while(n<=3) { welcome(); printf("\n\NLOGIN HERE!"); printf("\n\nUSERNAME : "); scanf ("%s",&username); printf("PASSWORD: "); for (i=0;i<16;i++) { ch = getch(); if(ch==13) { password[i]='\0'; break; password[i]=ch; printf("*"); password[i]='\0'; printf("\n\n"); system("pause"); if(strcmp(username, "rolan")==0) if(strcmp(password, "12345")==0) { welcome(); printf("\n\NYOU'VE LOGIN SUCCESSFULLY!"); break; else welcome(); printf("\n\nWRONG PASSWORD. You have %d attempt/s left...",3-n); else welcome(); printf("\n\NUSER DOESN'I EXIST. You have %d attempt/s left...",3-n); getch(); n++; if(n==4) { welcome(); printf("\nSORRY! YOU CAN'T LOGIN."); break; getch(); } }dont dont odntpost existing one sure cmpliant answr only 100% sure else skipQuestion 4: Ask the user for an account balance. Show, in descending order, all the accounts that have a balance greater than what the user input. Each entry is int, string, long, double, boolean (name length, name, credit card number, balance, cashback). File that was given https://bes.hypergrade.com/api/user/file/1923815 NOTE: It has to be printed and sorted by Balance (Higher value on top) =========================================== File one --------------------- public class Person implements Comparable<Person> {private long account;private String name;private double balance;private boolean YN;public Person(String name, long account, double balance, boolean YN) {this.account = account;this.balance = balance;this.YN = YN;this.name = name;}@Overridepublic int compareTo(Person per) {int compare = name.compareTo(per.name);if (compare == 0) {return 0;} else if (compare < 1) {return -1;} else {return 1;}}/*** @return the balance*/public double getBalance() {return…
- 6 Cell Phone PackagesCell Solutions, a cell phone provider, sells the following packages:300 minutes per month: $45.00 per month800 minutes per month: $65.00 per month1500 minutes per month: $99.00 per monthThe provider sells the following phones (a 6 percent sales tax applies to the sale of a phone):Model 100: $29.95Model 110: $49.95Model 200: $99.95Customers may also select the following options:Voice mail: $5.00 per monthText messaging: $10.00 per monthWrite an application that displays a menu system. The menu system should allow the userto select one package, one phone, and any of the options desired. As the user selects itemsfrom the menu, the application should show the prices of the items selected.Please answer properly with output screenshot must Where is the error in this code? from telethon.sync import TelegramClientfrom telethon.tl.functions.messages import GetDialogsRequestfrom telethon.tl.types import InputPeerEmptyimport os, sysimport configparserimport csvimport time re="\033[1;31m"gr="\033[1;32m"cy="\033[1;36m" def banner():os.system('clear')print("ok") cpass = configparser.RawConfigParser()cpass.read('config.data') try: api_id = cpass['cred']['id'] api_hash = cpass['cred']['hash'] phone = cpass['cred']['phone'] client = TelegramClient(phone, api_id, api_hash)except KeyError: os.system('clear') banner() print(re+"[!] run python3 setup.py first !!\n") sys.exit(1) client.connect()if not client.is_user_authorized(): client.send_code_request(phone) os.system('clear') banner() client.sign_in(phone, input(gr+'[+] Enter the code: '+re))os.system('clear')banner()chats = []last_date = Nonechunk_size = 200groups=[]result =…No plagarism please Upvote guarenteed. Thanks
- Dan’s recently announced that he’s teaching n top-secret courses next semester. Instead of enrolling in them through ACORN, students need to email Dan to express their interests. These courses are numbered from 1 to n in some arbitrary order. In particular, if a student named s is interested in taking a course c, they need to sendanemailtoDancontainingthemessagec s.Notethatifastudentis interested in taking multiple courses, they need to send multiple emails, one per course. Uponreceivingamessagec s,Danlooksatthelistofstudentsalreadyenrolledin course c. If there’s already a student on the list whose name is too similar to s, Dan assumes s is the same student and ignores the message. Otherwise, he enrolls s in the course. Dan considers two names too similar if and only if they have the same length and differ in at most one letter (note that “a” and “A” are considered the same letter). For example, “Josh” and “Josh” are too similar. “Sam” and “CaM” are too similar as well. However,…What does the Wait-Job -Name addFeature achieve? $featureLogPath = "c:\poshlog\featurelog.txt" start-job -Name addFeature -ScriptBlock { Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools Add-WindowsFeature -Name "dns" -IncludeAllSubFeature - IncludeManagementTools Add-WindowsFeature -Name "gpmc" - IncludeAllSubFeature -IncludeManagementTools } Wait-Job -Name addFeature Get-WindowsFeature | Where installed >> $featureLogPathJava jframe 6 Cell Phone PackagesCell Solutions, a cell phone provider, sells the following packages:300 minutes per month: $45.00 per month800 minutes per month: $65.00 per month1500 minutes per month: $99.00 per monthThe provider sells the following phones (a 6 percent sales tax applies to the sale of a phone):Model 100: $29.95Model 110: $49.95Model 200: $99.95Customers may also select the following options:Voice mail: $5.00 per monthText messaging: $10.00 per monthWrite an application that displays a menu system. The menu system should allow the userto select one package, one phone, and any of the options desired. As the user selects itemsfrom the menu, the application should show the prices of the items selected
- properties so that the given output is produced. Do not change any given code. s1 = ShoppingCart() p1 = Product("Razer BlackShark","Headset",99.99,5) p2 = Product.createProduct("Razer Huntsman","Keyboard",249.99,12) print("1.====================================") s1.addGadget(p1,p2) print("2.====================================") s1.setCartName("Amazon") s1.addGadget(p1,p2) s1.addGadget(Product("HyperX Fury","Mousepad",26.99,21)) print("3.====================================") print("Total Products created:",Product.totalProducts) print("4.====================================") s1.printCartDetails() print("5.====================================") s1.removeFromCart("Logitech G ProX Superlight") print("6.====================================") s1.removeFromCart("Razer Huntsman") print("7.====================================") s1.printCartDetails() Output: 1.==================================== Please set the cart name first. 2.====================================…Hi, how to i read multiple user input from the form ,load it into session storage and show it ? the code belows only stores a single value(fname) Was thinking to use for loop but it doesnt work hmm. Hope you can help me thankss:)) html5-local-session-storage-example.html <!DOCTYPE html> <html> <head> <title> Session Storage With Example</title> <script type="text/javascript" src="html5-local-session-storage-example.js" charset="utf-8"></script> <style> canvas{ display:inline-block; margin-top:10px; } </style> </head> <body> <h3>payment</h3> <form id="js_form" method="post"> <div> <label>Enter your first name.</label><br> <input type="text" id="fname" placeholder="Enter your first name." > <div class="invalid-feedback"> Valid first name is required. </div> </div> <div> <label>Enter your last name.</label><br> <input type="text"…To be coded in HTML and JavaScript: A mail-order house sells five different products whose retail prices are as follows: product 1,$2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; and product 5, $6.87. Write a scriptthat reads a series of pairs of numbers as follows:a) Product numberb) Quantity sold for one day