I need a form that accepts two operands and an operator from the user and then performs the requested operation. Specifications Before performing the calculation, the application should check that both operands are numeric and that the operator is one of the following: + add - subtract * multiply / divide It should also check that both operands are between 0 and 1,000,000 (non-inclusive). To perform this data validation, code IsPresent, IsDecimal, and IsValidData methods as described in chapter 7 of the book. In addition, code an IsOperator method that checks for a valid operator. Code a private method named …

Member Avatar
Member Avatar
+0 forum 10

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
Member Avatar
+0 forum 8

Howdy All - I am just wondering if anyone has successfully converted a *massive* (subjectivity implied) COBOL application to another language. If so, into which language was your system converted and when was this done? What were the potholes you, no doubt, hit? Was the conversion far more expensive than anticipated? What hidden costs were exposed? Was there a performance gain/loss in the new language? Did anyone convert from COBOL to PL/SQL? to T-SQL? to Java? to C#.NET? Thanks, and have a great day!

Member Avatar
Member Avatar
+0 forum 10

I have a program that is meant to display the total, average, student name and letter grade for a student. I'm almost done writing it but I have no idea how to make it loop so it goes back to step 1 from step 4. Everything I've read on using "while" loops hasn't really been helpful to me with this particular application. import java.util.Scanner; public class Averages5 { public static void main(String[] args) { // variable declaration String name; int mark1, mark2, mark3 ; int grade = 0; int A, B, C, F; double average; // input Scanner input = …

Member Avatar
Member Avatar
+0 forum 2

The API docs are now found at [ Java Development Kit Version 11 API Specification](https://docs.oracle.com/en/java/javase/11/docs/api/)

Member Avatar
Member Avatar
+0 forum 3

[B]Hi all.. I need to do a condition check in a script. The same condition check needs to be repeated in another script. So, I am looking for a way, where i can set, say a flag in the first script ,upon meeting the condition, and be able to access that flag in another script, instead of repeating the check all over again. Hope I am clear in explaining what I want to do. Can anyone pls give me suggestions? [/B]

Member Avatar
Member Avatar
+0 forum 13

Hi guys, I took it upon myself to learn the mysteries of linux. I'm trying to write a shell that can handle more than one pipe. Here's the code: [CODE] typedef struct command_link{ char *command; char *argv[MAX_ARGS]; int argc; struct command_link* next; int isPiped; }command_t; int pipedCommand(command_t *command) { int fd[2]; int status; int isFirstPipe = 1; int pid = -1; status = pipe(fd); if (status < 0) { printf("\npipe error"); return -1; } while (1) { pid = fork(); if (pid < 0) /*handle fork error*/ { printf("\nfork error"); return -1; } else if (pid == 0) /*handle son …

Member Avatar
Member Avatar
+0 forum 5

Hi, I Have below table I want all rows with all coloumn from below table where ActCode is 1162828 and sum of DocAmount for DocNo. i.e where the docNo is repeated i want only one row with sum of amount of all repeated rows. ** "Select *, Sum (DocAmount) from TblPurLedTranData whre TblPurLedtranData.ActCode='" & 1162828 & "' Groupby DocNo " ** PosDate DocDate DocNo DocAmount DueDate Status Period DocType FinYear Chan ActCode 10/10/2018 12/10/2018 369896     36980      11/11/2018 INV      5         PUST       2018       PUST       1243684    10/10/2018 12/12/2018 665        36000      11/01/2019 INV …

Member Avatar
Member Avatar
+0 forum 1

Hi all, I need to read a text file (I've attached it, you can take a look), and then store all the numbers in it into a 2D array. After which, I need to parse it. I need urgent help here! ):

Member Avatar
Member Avatar
-2 forum 49

Question from codility test Write a function: class Solution { public int solution(int[] A); } that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. Given A = [1, 2, 3], the function should return 4. Given A = [−1, −3], the function should return 1. Write an efficient algorithm for the following assumptions: > > N is an integer within the range [1..100,000]; > each element of array A is an …

Member Avatar
Member Avatar
+0 forum 8

I have class with main method like: public class Main { public static void main(String[] args) { long timeCheck; long periodOfTime; ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2); long initialDelay = 0; // the time from now to delay execution long period = 1; // the period between successive executions scheduler.scheduleAtFixedRate(new FeedReader(img, url, title, price), initialDelay, period, TimeUnit.DAYS); ... ... } } and another class with some code: public class FeedReader implements Runnable { private String img; private String url; private String title; private String price; public FeedReader(String img, String url, String title, String price) { this.img = img; this.url = url; this.title …

Member Avatar
Member Avatar
+0 forum 8

Hi guys, i'm having a difficulty to set the path in vb.net.i put the code in the module and every time i run the code it throws error "Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'." here's the code Public conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\\Adigrat.accdb;Persist Security Info=False")

Member Avatar
Member Avatar
+0 forum 7

Below is my code for adding parameters in my vb .net code for prepared statements of npgsql. Dim xConn As NpgsqlConnection = ConnectDB() Dim xCmd As NpgsqlCommand = xConn.CreateCommand() xCmd.CommandText = "UPDATE " & xTable & " SET previous_tot_adj = @prev_adj ,tot_adj = @tot_adj WHERE version = " & _version & " AND monthly_mq_id = @Index" For Each Index In _Results.Keys If Not IsNothing(_Results.Item(Index)) Then xCmd.Parameters.AddWithValue("prev_adj", NpgsqlTypes.NpgsqlDbType.Double, _Results.Item(Index)) xCmd.Parameters.AddWithValue("tot_adj", NpgsqlTypes.NpgsqlDbType.Double, _Results.Item(Index)) xCmd.Parameters.AddWithValue("Index", NpgsqlTypes.NpgsqlDbType.Bigint, Index) End If Next xCmd.Prepare() xCmd.ExecuteNonQuery() After executing this code i get this kind of error . > A first chance exception of type 'Npgsql.NpgsqlException' occurred in …

Member Avatar
Member Avatar
+0 forum 2

I am trying to display this SQL query in a table. String query = "SELECT COUNT(`appointmentId`),EXTRACT(MONTH FROM `start`) FROM `appointment` WHERE YEAR(start) = '" + year + "' GROUP BY EXTRACT(MONTH FROM `start`)"; Unfortunately I cannot alter the database. I am trying to list the total appointments per month on a table or perhaps a TextArea. Any ideas please? Thanks!

Member Avatar
Member Avatar
+0 forum 2

All, For the life of me I cannot get this program to compile. The error message "error: non-static variable this cannot be referenced from a static context" occurs on lines 23 and 24. Here is the entire program: [CODE]public class ThreadTest { public static int x = 0; public class Counter implements Runnable { private int i; private int temp; public void run() { for (i=0; i<10; i++) { temp = x + 1; x = temp; } } //End run() } //End class Counter public static void main (String[] args){ Counter myCounter1 = new Counter(); Counter myCounter2 = new …

Member Avatar
Member Avatar
+0 forum 9

This is a tutorial, not a program. [b]Step 1[/B] First, create a file for your website, and name it "admin.html". [b]Step 2[/b] Now on it, say, "You must log in to view admin, blah,blah,blah. Click here to launch our client." [b]Step 3[/b] Link "Click here" with the C++ .exe file we will create later. [b]Step 4[/b] Now, create a new file with a bunch of random letters, then ".html". Make the file name AT LEAST 100 characters long. All your admin stuff will go here. [b]Step 5[/b] Now Start a C++ program, and type the following: [code=c] #include <iostream> #include …

Member Avatar
Member Avatar
-5 forum 10

Hi Guys, I ussually dont post anything here often, just get everything off of everyone elses questions, but I'm having a strange problem that im scratching my head over, I have a JTable where I can Add and remove rows... This is just for testing purposes, I'm about to make a ingrediants program. The thing is whenever I change one of the Comboboxes they all seem to change.. its really wierd, Could Someone run this and help me out, this is probably a stupid mistake? See my Code Below, My Main package doughtracker; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; /** * * …

Member Avatar
Member Avatar
+0 forum 13

how can i limit a user to enter 10 digit no like telephone no in textbox without using regular expressions?????

Member Avatar
Member Avatar
+0 forum 16

Hey guys, I have a little bit confused on below code and output **Main ** public class Main { public static void main(String[] args) { ClassA classA = new ClassA(); System.out.println("====== Before ====="); classA.checking(); System.out.println("===== After ====="); classA.checking(); } } ** Class A** public class ClassA { boolean b = true; public String checking() { System.out.println("B value is " + b); if (b = true) { System.out.println("B is true"); b = false; } else { System.out.println("B is false"); } return null; } } ** Output** ====== Before ===== B value is true B is true ===== After ===== B value …

Member Avatar
Member Avatar
+0 forum 4

Hi! My name is Jung and I'm new to VBNET I have already tried many ways to write codes for "btnSearch" but seems like nothing works.. I really need help for this as the deadline is around the corner :'( Below are my codes for Search button.. ![btnsearch.PNG](/attachments/large/4/76be068c625e23d9a57e969a97509bee.PNG "align-center")

Member Avatar
Member Avatar
+0 forum 2

#include<stdio.h> int main() { int x=5; int y=50; do{ x = x + 10; }while (x <y); printf("%d\t%d", x,y); } I wonder why i compile is 55 50 why not 15 50???

Member Avatar
Member Avatar
+0 forum 1

hello sir how can I get my system short date format in a label in vb. net. I try this code : Label1.Text = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern() but show wrong data. all time show "M/d/yyyy" format. I change it(to "dd/MM/yyyy") manually and by coding result is same("M/d/yyyy") please help me..... For Change the Format: Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\International", "sShortDate", "dd/MM/yyyy")

Member Avatar
Member Avatar
+1 forum 3

When this news came across I only had to think of MSFT's prior acquisitions to think this may not end well. As the song goes " Should I Stay or Should I Go"?

Member Avatar
Member Avatar
+1 forum 7

Hi, I am currently working on a VB form for a college assignment. I am trying to add quantities from a ListBox and then display the result in a TextBox for a pizza delivery order by using a button. So far, the Listbox shows: pizza type Quantity pizza price Total pizza price The Total pizza price is the value that I want to add together and then show in a TextBox as an Order Price. This is my form and Code for the button: ![form1.PNG](/attachments/small/4/3da7c8769c68d4284e57a3e1644c9627.PNG "align-left") ![form.PNG](/attachments/small/4/a41c26183938bc03cb984f467c5bb361.PNG "align-left") ![form1_buttoncode.PNG](/attachments/small/4/710dcd869220381dab6204948dc6f362.PNG "allign right") The code is a work in progress and as …

Member Avatar
Member Avatar
+0 forum 5

Hello fellow python lovers of daniweb.com. This isn't as much a question as much as the fact that I want to see how different people would go about using python to inject an SQl database. I made a script were you can access the ip and run a command. NOTE:Obviously I didn't give an actual database. Who am I kidding you guys aren't stupid. Here's my injection script import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="USER", # your username passwd="PWD", # your password db="MySQLdb") # name of the data base # you must create a Cursor object. …

Member Avatar
Member Avatar
+0 forum 4

Fellow Python developers, Python has a sorted() or sort() function to implement ascending or descending order programs,but supposing if i want to develop a ascending order program that takes user input and ascends or descends them,how should I go about? For Example: Lets Say i want to convert this C program to Python? # include <iostream.h> # include <conio.h> void main() { int a[10],i,j,n,temp; clrscr(); cout<<"\nEnter n nos: "; cin>>n; cout<<"\nEnter the numbers: "; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) for(j=i+1;j<n;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } for(i=0;i<n;i++) cout<<a[i]<<endl; getch(); } This is an ascending order program in C. Thanks in …

Member Avatar
Member Avatar
+0 forum 4

How can I show the database in a single mode (windows or SQL authentications mode) please help me..... How can I Show the database in a single mode (windows or SQL authentications mode) please help me. I create a project VB.NET 2010 and SQL server 2008r2 , When I login sa account show the database it is all right. But problem is when I connect windows authentication mode same database show on there, and it is fully accessible. I want to when I login sa account show the database, not show when login in windows authentication mode.

Member Avatar
Member Avatar
+0 forum 1

I'm trying to make a button that when pressed for a short while will close the form but when pressed for a long time *e.g. 5s* the form's process will be killed. I'm trying to achieve this with a timer. Private Sub CloseLongTimer_Tick(sender As Object, e As EventArgs) Handles CloseLongTimer.Tick Dim SetTime As Integer = 0 SetTime = SetTime + 1 If SetTime < 500 Then Me.Close() ElseIf SetTime > 499 And SetTime < 1001 Then System.Environment.Exit(1) ElseIf SetTime > 1000 Then CloseLongTimer.Stop() End If End Sub Private Sub CloseButton_MouseDown(sender As Object, e As EventArgs) Handles CloseButton.MouseDown CloseLongTimer.Start() End Sub …

Member Avatar
Member Avatar
+0 forum 4

Hello, I'm hoping for some help with a regex that has me stumped. My skill with regex is rather rudimentary. To start, here are a couple of example URLs, and whether I want to match them or not: collection/col1 // MATCH collection/col2 // FAIL collection/col1/products/pro1 // FAIL My criteria: * One single regex (cannot be multiple expressions) * I have a list of "col"s to fail on. For example, I do not want to match if specifically "col2" or "col3" are in the URL * Aside from col2 or col3, i can have any col[#] in the URL * Even …

Member Avatar
Member Avatar
+0 forum 4

Hi i have been spending the last few days deciding on an IDE that would let me program in Java, C++ and python and notepad++ looked pretty good. The only issue is i cant work out how to make the program run once i have made it. I looked in google and i couldn't find any tutorials to set it for python but if anyone could help that would be greatly appreciated. Thanks!

Member Avatar
Member Avatar
+1 forum 8

The End.