31,001 Topics

Member Avatar for
Member Avatar for moosh101

Hello everyone! I am writing a program for the birthday paradox that runs trials 10,000 times. I want to show that when N people are in a room, there is a 50% chance that there will be a duplicate birthday. I want to create an empty set, then add to …

Member Avatar for toneewa
3
540
Member Avatar for amontellano

Hi everyone, I need ideas on how to initialize a new program in which a class GeometricSequence will extend Sequence. It has to implement public void generate ( ), which generates the sequence via 𝑎𝑖 = 𝑎0∙generator𝑖 (𝑖 = 0, 1, …, numTerms−1) and puts it into a double []. …

0
61
Member Avatar for amontellano

Hello everyone, so I was working on ClippedAudio.java, and the program is supposed to clip the signal. The read method reads in the file audio.txt, the clip method clips the signal, and the write method outputs the clipped signal to the file clipped_audio.txt. I have to add the needed code …

Member Avatar for amontellano
0
23
Member Avatar for amontellano

Hi everyone, I need ideas on how to initialize a new program in which a class GeometricSequence will extends Sequence. It has to implement public void generate ( ), which generates the sequence via 𝑎𝑖 = 𝑎0∙generator𝑖 (𝑖 = 0, 1, …, numTerms−1) and puts it into a double []. …

Member Avatar for amontellano
0
35
Member Avatar for sadbin hoque

package sadbinproject; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; /** * * @author Notebook */ public final class admission_panel extends javax.swing.JFrame { /** * Creates new form admission_panel */ public admission_panel() { initComponents(); Connect(); } Connection con; PreparedStatement pst; public void Connect() { …

Member Avatar for JamesCherrill
0
187
Member Avatar for ervineuer

Im looking for the "best" GUI builder for java. I use Eclipse to write my scripts, and i would appreciate you guys telling me your favourite GUI Builder and the reasons why. Thanks

Member Avatar for jwenting
0
82
Member Avatar for Jinhwan

Create a class named SavingsAccount and provide a method called deposit to allow a customer to deposit to his savings account, another method called withdraw to allow a customer to withdraw from his savings account, ensure that the debit amount does not exceed the savings account balance. If it does, …

-2
108
Member Avatar for nirmal.patel.59

I am working on search API. Currently I am havinng 3 filter i.e. author, publish date, topic. Now I have created a Search API along with paginantion. based on request data it provides result (default page size is 10 for pagination). Now I want to acheive following. Whenver I change …

Member Avatar for Dani
0
107
Member Avatar for federerforehand

I do not know where to even start :'( can someone please write the code so I can see the process and I can do other problems that are similar to this... For this programming project, you will create a program that will both design and implement a class that …

Member Avatar for Jerry_23
-2
4K
Member Avatar for Khoa_2

Hi everyone, i want to solve the problem below with dynamic programming but i dont know where to start. Can anyone suggest me something? So the problem is about the find the minimum path with maximums golds. This is the code i have tried so far but it gets me …

Member Avatar for rproffitt
0
157
Member Avatar for asfghjkl

Hi everyone, I just want to ask if how i am able to make an if else statement inside a switch case. i want to execute something wherein the user may be able to choose again if he/she would like to do another transaction. for example, the user choose Yes …

Member Avatar for kasmar45
0
257
Member Avatar for nextsmm

Is it necessary to have computer or laptop to test the code? Did you ever seen anyone who can be perfect or master in coding whit cell phone?

Member Avatar for DGPickett
3
221
Member Avatar for Dean_14
Member Avatar for jeff79
Member Avatar for eliasarximan

Can Someone help me to convert my Python Code to Java Code please? My Python Code : def import_file(file): with open(file,"r") as f: lines = f.readlines() sline = [] for line in lines: xline=line.split(" ") sline.append(xline) return sline def set_file(idf,q,sline): for i in sline: if idf in i: sline[sline.index(i)][1] = …

Member Avatar for Srinu@231
0
282
Member Avatar for shak187

hi there i have some python coding which i need to convert to java can ne1 help me please email me back if you can help then i will show you the coding much appriciated

Member Avatar for eliasarximan
2
154K
Member Avatar for AbstractEden

I've been having a tough time trying to figure this one out. Wrote a couple of notes on my phone and ended up with this as a result: import java.io.*; import java.util.Scanner; public class Assignment1 { //Returning if a character is a vowel or not. public static boolean isVowel(char c) …

Member Avatar for alex205
0
3K
Member Avatar for Kurosaki

Hi. I'm new to java programming and I need help with this assignment. [quote]Giving change. Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Compute the difference, and compute the dollars, quarters, dimes, …

Member Avatar for JamesCherrill
0
7K
Member Avatar for Iskodaraog

Direction: create a program to computer for the final grade using scanner and JOptionpane. Given: Quiz- 20% Activity-60% Exam-20% Output Enter guiz grade: Enter activity grade: Enter exam grade: The final grade of: (Student name) si: (total of quiz, activity,and exam grade

Member Avatar for Kazalwadi
0
66
Member Avatar for dimitrilc

## Introduction ## When localizing your application, `ResourceBundle` can be a great way to load Strings from different locales. The only concrete implementation of ResourceBundle is `PropertyResourceBundle`, which allows us to load static Strings from a text file. Because `.properties` is a common file extension used for ResourceBundles, creating ResourceBundle …

2
197
Member Avatar for dimitrilc

## Introduction ## Junit is a popular framework to create tests for Java applications. Although individual unit tests are mostly straightforward, integration and functional tests are a little bit more involved because they usually require multiple components working together. For that reason, understanding the life cycle of Junit tests can …

2
208
Member Avatar for dimitrilc

## Introduction ## When collecting a stream, the `groupingBy()` Collector(`java.util.stream.Collector`) can be used to put data into different groups based on specified conditions. `groupingBy()` is a little bit more complicated to use than [partitioningBy()](https://www.daniweb.com/posts/jump/2280662) because the key can be of any type, whereas with `partitioningBy()`, the keys must be of …

2
105
Member Avatar for dimitrilc

## Introduction ## Whenever we want to modify numbers from multiple threads running concurrently, such as modifying a counter, one of the best options is to use the AtomicX classes. The most basic numeric atomic classes are AtomicInteger and AtomicLong. In this tutorial, we will learn how to use the …

2
80
Member Avatar for makmuhefe

Hello, I need to convert C codes to Java codes.this promram calculates surface areas of a 3D geometry which is read from datas from text file.thanks for help. text file: [CODE=text]12 0 0 0 0 0 1 4 0 1 4 0 3 5 0 3 5 0 0 0 …

Member Avatar for K3haled
0
9K
Member Avatar for hweyeongimnida

The code is here: https://medium.com/swlh/balancing-chemical-equations-with-python-837518c9075b

Member Avatar for rproffitt
0
47
Member Avatar for dimitrilc

## Introduction ## If you are a Java developer coming to Kotlin, you might have wondered how to use a language construct that is similar to the try-with-resource statement in Java to automatically close Autocloseable/Closeable resources for you. Luckily, Kotlin provides the inline extension function `use()` that provides similar functionality …

2
319
Member Avatar for dimitrilc

## Introduction ## In Java, a common way to express a type that is a combination of two or more types is to just create an interface that extends the other types. The problem with this approach is that your code might be littered with interface declarations, polluting your code …

2
148
Member Avatar for dimitrilc

## Introduction ## In this tutorial, we will look at the RxJava `mergeWith()` and `concatWith()` operators. Amongst others, they are used to combine Observables together. All of the RxJava operators have ambiguous names, and behave differently, so let us take a look at 2 operators, `mergeWith()` and `concatWith()`, to see …

3
877
Member Avatar for dimitrilc

## Introduction ## RxJava 3 includes 5 core classes: 1. Flowable, 2. Observable, 3. Single, 4. Completable, 5. Maybe. This tutorial aims to teach the basic concepts behind Observable, which serves as a foundation for understanding the other 4 classes. ## Goals ## At the end of the tutorial, you …

3
1K
Member Avatar for Official_2

A shop owner has 2 outlets namely a High Street Branch and Mall Branch, before Covid19 lockdown the respective shops recorded sales as follows: High Street Branch Quarter Sales Q1 42,000 48,000 50,000 Q2 52,000 58,000 60,000 Q3 46,000 49,000 58,000 Q4 50,000 51,000 61,000 Mall Branch Quarter Sales Q1 …

Member Avatar for wwwalker
0
312

The End.