//With this method, I input a string and return an array that contains a sorted list of characters as per the frequency. Eg: If i input "apple", the out put should be p,a,l,e, How do I do this? public static ArrayList<Character> characterFreqDist(String statement) { char[] Array = statement.toCharArray(); int length = Array.length; int most_frequent_count = 0; char most_freq_character = '\0'; char[] Final_Array = new char[length]; ArrayList<Character> Sorted_Array = new ArrayList<Character>(); for(int loop = 0 ; loop<length ; loop++) { most_freq_character = '\0'; most_frequent_count = 0; for(int i = 0; i<length ; i++) { char single_character = Array[i] ; int counter …

Member Avatar
Member Avatar
+0 forum 5

Hi, how do I sort the string in alphabetical order? find most occuring character("blablabla") remove most occuring("aaa") input: blablabla output: "aaa"

Member Avatar
Member Avatar
+0 forum 1

Hello all, I was wondering if I could get some questions answered about how cupons work in the work place. I have an idea which involves creating a very flexible cupon service, but would require knowing the rudiments of how cupons work. The main question I have is how is tax calculated on a ware as it is sold under a cupon service. I believe that would be the only thing I would have to stringently mandate as far as the cupon goes, since the institution wishes to clear the merchendise from the floor. The service would involve some C# …

Member Avatar
Member Avatar
+0 forum 3

I am currently studying for an "Associates in Computer Science" with the intention of tranfering to a four year collage to get either a "Bachelors of Computer Science" or a "Bachelor of Applied Computer Science" hopefully this spring. Before I can make a decision on which Bachelors I would like, I have to know what type of job the Computer Science field I would want however I currently don't know the exact diffrence between some of these jobs in programing. Can anyone (perhaps who is more expreince in this job field) first explain the diffrence between some of the jobs …

Member Avatar
Member Avatar
+0 forum 9

i have 2 sperate projects which i am trying to run together as a shared project but i am failing hard……. Basically, first project does infix to postfix notation and the second projects does postfix evaluation. tried to run all that in 1 project but i keep getting all sorts of error and cannot figure it out, I am kind of lost don’t know what to do. any suggestions would be really appreciated!!!!!!!!! the first 3 files is infix to postfix project and the last one is posftix evaluation. this is the calculator.cpp #include "stdafx.h" #include "Calculator.h" #include <iostream> #include …

Member Avatar
Member Avatar
+0 forum 6

Hello, I am building a calculator in c++ windows application form, i want the calculator to handle multiple operator precedence (for example, 2+4*5/3). but i am not sure how to write the following code on my windows form project. Any suggestions would appreciated . #include <iostream> #include <conio.h> using namespace std; int main() { int num1 = 0, num2 = 0, num3 = 0, num4 = 0, num5 = 0; char op1, op2, op3, op4; int total1 = 0, total2 = 0, total3 = 0, total4 = 0; cout << "Enter five values with operator to calculate=>"; cin >> num1 …

Member Avatar
Member Avatar
+0 forum 6

Hello. I got one question, when i want to streamplot this, i got eror: "raise ValueError("The columns of 'y' must be equal")", i can't figure it out. :/ Thank you for your time. this is entire code: import matplotlib.pyplot as plt import numpy as np # discretization of domain x_start, x_end = 0. , 10. y_start , y_end = 0. , 8. i = np.linspace(x_start, x_end, 80) j = np.linspace(y_start, y_end, 50) X,Y = np.meshgrid(i,j) Y[:,:40] += 1 Dx = x_end/(np.size(i)-1) Dy = y_end/(np.size(j)-1) beta = Dx/Dy nx = np.size(i) #number of points on x axis ny = np.size(j) #number …

Member Avatar
Member Avatar
+0 forum 1

Hi Friends, Recently I've experienced an issue in my (following) code. I've designed an array-stack and checked the values pushed in to it. It works well when pushing but when popping it doesn't display the whole popped values. E.g: If I pushed the values "zero to nine" in to the stack, even though they are pushed successfully, their popping displays only "nine to five". Why it behaves like this? Could anyone suggest a solution for this? #define MAX 10 #include <stdio.h> #include <stdlib.h> struct stack{ int stackSize; int items[MAX];}; void push(struct stack *sp, int newItem){ if((sp->stackSize)<MAX){ sp->items[sp->stackSize++]=newItem; printf("Pushed %d\n",newItem); } …

Member Avatar
Member Avatar
+0 forum 3

# Split a dataset based on an attribute and an attribute value def t_split(x, y, z): l, r = list(), list() for row in z: if row[x] < y: l.append(row) else: r.append(row) return l, r # Calculate the Gini index for a split dataset def gini_index(grp, class_values): gini = 0.0 for class_value in class_values: for group in grp: size = len(group) if size == 0: continue proportion = [row[-1] for row in group].count(class_value) / float(size) gini += (proportion * (1.0 - proportion)) return gini # Select the best split point for a dataset def get_split(dataset): class_values = list(set(row[-1] for row …

Member Avatar
Member Avatar
+0 forum 1

Hello eveyone, I want to write a MARIE code to perform the following program excerpt: If (x < y + z) { x = x – y; z=z+1; } else y=y-1; Instactions given: - Use “ORG” instruction to start your program at address 200. - The following labels and directives should be included at the end of your program: X, Dec 4 Y, Dec 2 Z, Dec 5 One, Dec 1 I do not know how to use if statments in marie, all I know is how to add, subtract and multiply ( the basics) any help would be really …

Member Avatar
Member Avatar
+0 forum 6

How to implement bucket sort in C using Linkedlist.. Or any weblinks please share...

Member Avatar
Member Avatar
+0 forum 1

hi guys im new to c++ can i have some assist ? The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets box, sideline, premium, and general admission. After each game, data is stored in a file in the following form: ticketPrice numberOfTicketsSold 250 5750 100 28000 50 35750 25 18750 output the number of tickets sold and the total sale amount. Format your output with two decimal places. my current file for SampleData.txt 250 5750 100 28000 50 35750 25 18750 my …

Member Avatar
Member Avatar
+0 forum 7

Hi, Daniweb. I have this hobby project I'm playing with where I need to generate data for a MonteCarlo simulation. The data needs to fit within a bell-curve around a given mean with a standard-deviation. I'm trying to figure out which random distribution system I need to use and how to use it. Disclaimer: It's been at least 3 years since I took Statistics and I barely remember what a Z-score is. Be kind in your replies. EDIT: Every. Single. Time. https://msdn.microsoft.com/en-us/library/bb982827.aspx

Member Avatar
Member Avatar
+0 forum 1

I am an aspiring (at the age of 27) programmer using C++. I have future undertakings including getting a refresher course at a premier University in my country. I am just interested to know in advance how it is to become a programmer. What are the regular routines that you do to start and end your day (shift) as programmers? Is it all about programming from login to logout? Are there other things that you do such as reporting, documenting, taking a cup of coffee, then coding, coding,coding.... Thank you guys in advance. Your answers will mean a lot to …

Member Avatar
Member Avatar
+0 forum 7

I have a Combo box/Dropdown and when a user clicks an option I want the combo box to set the text onto a jTextField. For example: if(carsJComboBox.getSelectedIndex() == 0) { currentCarsJTextField.setText("250 Million"); } if(carsJComboBox.getSelectedIndex() == 1) { currentCarsJTextField.setText("500 Million"); } The problem is that when the program runs, it automatically sets 250 Million to the JTextField. I understand why it does that because 250 Million is the first drop down option, but the JTextField never updates. When I choose the option below 250 Million, which is 500 Miliion and click on it, it doesn't set the JTextField text to 500 …

Member Avatar
Member Avatar
+0 forum 3

Hi, I need help reading this [.csv file](https://drive.google.com/open?id=0B5UH8MuMzUBaR0FRYmhTWnNxdW8) into an array of vectors i created below: `vector<string> GID; // Vector holding Gift ID vector<string> DName; // Vector holding Donor Name vector<string> Phone; // Vector holding Phone Number vector<string> POC; // Vector holding point of contact vector<string> Item; // Vector holding item donated vector<string> Category; // Vector holding type of item donated vector<double> amount; // Vector holding amount of donated items` and also how do i remove the commas so i can use it do mathematical operations

Member Avatar
Member Avatar
+1 forum 7

I have a problem with my pseudocode: Declare Integer p1 Declare Integer p2 Declare Integer p3 For p1 = 1 To 3 For p2 = 65 To 66 For p3 = 6 To 8 Display p1, p2, p3 End For End For End For This would display 18 combinations. But, I want to convert and display the character code (in this case 65 and 66) to the character. So instead of "1658", I want it to be "1A8". How can I fix this? I've tried putting ToChar with p2 (Display p1, p2, ToChar(65), ToChar(66), p3), but no avail. Please help! …

Member Avatar
Member Avatar
+0 forum 6

I have this problem which says, "A programmer can use the random feature to emulate the flipping of a coin. For example, if the generator produces a number 0 or 1, the value 0 can be assigned heads and the value 1 can be assigned tails. Write a program that "flips" a coin 50 times. Count the number of times the result is heads. Count the number of times the result is tails." I am using Flowgorithim (a flowchart and algorithim combo) and so far I have: Declare Integer heads Declare Integer tails Declare Integer flipCoin Declare Integer count Display …

Member Avatar
Member Avatar
+0 forum 3

Hello i have list of football teams on every line is a new team but there are countries in brackets i want to remove all of them, here is a example of the list: Águila (El Salvador) Águilas (Costa Rica) Águilas Doradas (Colombia) Árabe Unido (Panama) Åtvidaberg (Sweden) Ñublense (Chile) Örebro (Sweden) Örgryte (Sweden) Öster (Sweden) Újpest (Hungary) Ústí nad Labem (Czech Republic) Čelik Nikšić (Montenegro) Čelik Zenica (Bosnia and Herzegovina) České Budějovice (Czech Republic) Čukarički (Serbia) İnter Bakı (Azerbaijan) Pls help me with this, so acually i need to take the first bracket on every line and delete the …

Member Avatar
Member Avatar
+0 forum 5

I need an idea for cloud computing graduation project. I was thinking about security and encryption , but most of the ideas are more suitable for a research rather than an application, so I am thinking of making a cloud-based embedded system. What kind of embedded systems can benefit from cloud computing?

Member Avatar
Member Avatar
+0 forum 2

Hello all, Inverting an upper (or lower) triangular matrix is a trivial algorithm, due to the nature of the matrix. I am having an issue getting a part of my upper-triangular matrix inversion function to work, and I would like to get it working soon for a personal project. From reading a verbal description about this special inverse case using back-substitution, I have written some C++ code. I give it an input example 6x6 matrix, it inverts the diagonal correctly, but produces incorrect results above the diagonal. I am checking the true answer using the 'Online Matrix Calculator'. The code …

Member Avatar
Member Avatar
+0 forum 3

There is a problem of facility location that I solve with genetic algorithms. I can get good results. So I would like to compare my genetic algorithm complexity O(n^2) with the brute force algorithm. But I am not getting an answer. (n = number of individuals in my population, usually 200.) See the picture attached. Ignore the gray and pink squares. I want to know the complexity to find all the solutions for the problem. The problem is how I can connect the blue circle to the black squares. In the picture, you can see one possible combination. But in …

Member Avatar
Member Avatar
+0 forum 8

Design and implement an application that determines and prints the number of odd, even, and zero digits in an integer value read from the keyboard. (java) using for loop

Member Avatar
Member Avatar
-4 forum 7

I am writing a code for a user to choose numbers in a progress bar. For some reason the progress bar does not fill up or empty when the int progress is not exact. For example: The progress bar value is 5 at the moment. The user chooses 250 Million Cars whose progress value is 7 but the progress bar does not empty. Is there an algorithm or a method that can fix this problem Thank you. public class Tester extends JFrame implements PropertyChangeListener { private JButton backJButton; private JComboBox carsJComboBox, treesJComboBox; private String[] newnumbers = {"Add 250 Million","Add 500 …

Member Avatar
Member Avatar
+0 forum 1

so the program needs to dynamically allocate an array large enough to hold a user=defined number of test scores. once all scores are entered, the array should be passed to a function that sorts them in ascending order. another function should be called that calculates the average score. the program should display the sorted list of scores and averages with appropriate headings. use pointer notation rather than array notation whenever possible. the problem i am having is making it so that the program doesn't accept negative numbers for test scores. errors - Error C4716 'showAverage': must return a value ConsoleApplication9 …

Member Avatar
Member Avatar
+0 forum 2

Please see attachment. Any help is appreciated! :D

Member Avatar
Member Avatar
+0 forum 2

I wrote this code : #include <stdio.h> int main() { int a,b = 10,c,d; a = printf("b is %d\n",b); c = printf("a is %d\n",a); d = printf("c is %d\n",c); printf("d is %d\n",d); // lose a null terminator in the previous strings ?? c and d // are 7, but a is 8, and when you count characters in a's string theres 8, // and also 8 in c, and d, yet c and d only retain a 7 value count. WHY? a = a + b + c + d; // now lets add them together printf("Added together %d\n",a); // …

Member Avatar
Member Avatar
+0 forum 3

Hi. so we have this tutorial, a program that we have to complete, that we have to do before attending class and I've sort of completed it except for this small error. > Exception in thread "main" java.lang.Error: Unresolved compilation problems: > id cannot be resolved or is not a field id cannot be resolved to a variable id thats refered to is in the Main Class: System.out.println("###### Our Loyalty Programme ###### \n"); System.out.print("Enter Member ID >> "); String.id = sc.nextLine(); System.out.print("Enter Name >> "); String name = sc.nextLine(); Member member = new Member(id, name); LoyaltyCard card = member.getCard(); **Problem …

Member Avatar
Member Avatar
+0 forum 3

Hello all. I apologize in advanced if this has been asked before but I have not been able to find this information via google or searching here. Everything I found is related to how a for loop works. I know how to use a for loop in python and what my input will do and what the output will be. My question is more related to how the syntax itself actually works: I have the very basic example: for i in range(10): print i I know that this will print 0 through 9 one at a time and that is …

Member Avatar
Member Avatar
+0 forum 3

Hello, I have 2 **wstring** variables: std:wstring first =L"Jose"; std:wstring second = L"James"; How can I combine these variables: first + second gives an error in Visual Studio. Cheers

Member Avatar
Member Avatar
+0 forum 3

The End.