I literally don't know what I need to do for this but it needs to be done and evaluated within a couple of days - netbeans

1 It's an Emergency.
2 For one of my programming units we have to create a 'UCAS' points calculator in Net beans. UCAS sort out all of the university stuff in the UK.
3 So I need to create a GUI that has text boxes and buttons and I need to enter the amount of passes, merits, and distinctions I've got on my course, which will give me a total amount of UCAS points.
4 Passes = 70 points
5 Merit = 80 points
6 Distinctions = 90 points
7 There's 18 units in total, so if I enter I have 4 passes (a pass for 4 units) the box with the total amount of UCAS points needs to go up.
8 I need three boxes, one for passes, merits, and distinctions, and the box for the total amount of UCAS points. It needs a calculate button of course and a 'reset facility'. It says that the current date needs to be seen on the interface.
9 It also says that there should be an option to quit the program at any time.
10 It has to be a **GUI** and I literally don't know what to do and I don't want to fail again.
11 Can someone help me?
12 I literally don't know how to make the buttons work or anything.
I don't even need any help I just need someone to show me exactly what to do because I haven't got a clue.

Related

Tableau Parameter/Reference Line Help - Change One Column Instead of All

I have received a workbook from a coworker and they used parameters to give a color code (green when under two hours, red between 2 and 4, red between 4 and 6, red between 8 and 10). The ask was to change only one of the columns. In this case I need to change the between 2 and 4 Avg. Cycle Time for Process Cycle to green and leave the other 4 Cycles as red.
This is what my reference lines are showing for this column.
and this is what my parameter is set up like.
The values I believe are from Avg. Cycle Time (hours).
I have tried setting other parameters, I have tried using level of detail for some attempts, I'm fairly new to tableau and just needing some guidance here.

Structuring an experiment with psychtoolbox

I have a design for an experiment that I would like to code in psychtoolbox using MATLAB. I understand the basics of how to use this toolbox however it would be extremely helpful if someone has designed a similar experiment before and could provide me with some code that could help me to carry out the following:
The experimental procedure will be composed of 80 trials divided into 5 blocks with 16 trials in each block. The experiment consists of the participant selecting a number from the screen. There is a desirable number (target number) and an associated less desirable number (lure number). I won't go into further detail about the reasoning behind this experiment as it is not relevant to my question.
I have attached an image that shows 1 block of trials (16 trials). The other 4 blocks are the same as this block.
Target and lure numbers will be presented on the screen to choose from (an example can be seen in image below).
In some of the trials as can be seen from the trials table only one target number and one lure number are presented for the participant to choose from (instead of two targets and two lures).
The lure(s) that appears with each target(s) should not always be the same. I want the lure that is shown with the target to be randomly selected in each trial (as can be seen in the trials image there is more than one possible lure). In the trials image I have attached the trial numbers are presented just for clarity, in each block the presentation of the targets needs to be randomized.
You can use the BalanceTrials function that comes with psychtoolbox. You use all the possible lures and targets as inputs and it returns a random order of all possible combinations. You can also specify a minimum length of the list it returns, but if there are more combinations it will make the list longer to make it balanced. Here is an example:
numberOfTrials = 80;
targetNumbers = {'3','4','5','6','7','4 5','4 6','4 7'};
lureNumbers = {'3','4','5','6','7','4 7'};
[targets, lures] = BalanceTrials(numberOfTrials, 1, targetNumbers, lureNumbers);
You can split this up into 5 blocks or you do it each time for each block.

Netlogo: Built-in function to calculate the expected profit

Sorry for long post. I am newbie in agent-based modelling. So please accept my apology in advance if my question sounds stupid. I am trying to model a scenario where framer (i.e. agent) decides which type of crop should be harvest in different types of fields to increase the profit. The farmer agent has a budget i.e. the amount of money that can be spent on farming each time step equal to $100.
The farmer operates a farm that is subdivided into nine fields, which are arranged in a 3x3
cellular grid. Each field is of the same size. Water availability varies spatially across the fields with a rating of either 1 (driest), 2 (moderate),
or 3 (wettest). The manner in which water availability varies across the fields (i.e. randomly).
The farmer must choose among three crops. As initial parameter settings, the crops have the
following characteristics:
Yield Price Costs Minimum Water Req.
Crop 1 300 20 15 3
Crop 2 200 12 10 2
Crop 3 100 7 5 1
Each crop requires a certain amount of water to grow. Crop yields will only be realized if the crop is
planted in a field with at least the crop’s minimum water requirement.
Now the problem is that I couldn't find any function in Netlogo that calculates the permutation or combination of crop, field, and water requirements to calculate the expected profit. Any help would be high appreciated.
I believe you describe a linear programming problem.
Useful functions for solving Simplex Linear Programming problems are in NumAnal extension, which does not come bundled with NetLogo but which you can get as follows:
In NetLogo, under Tools / Extensions ... you can find NumAnal, probably with no green check-mark. Select it. On the right, you have buttons to install it, and then one to add it to your code. When you click those, it should now get a green checkmark and you should have a new line in your code "extensions [ numanal ]", and you are now able to use those commands, with the "numanal:" prefix, for example, numanal:simplex.
The documentation for it is in the folder where it was installed. But where is that?
Sadly, the documentation for where extensions are downloaded is not current.
https://ccl.northwestern.edu/netlogo/docs/extensions.html#where-extensions-are-located
After exhaustive search by date-modified, I actually found the folder on my Windows 10 laptop here: c:\Users\condor\AppData\Roaming\NetLogo\6.1\extensions
( Note the "\Roaming\" ).
That folder has a README.md text file, and a pdf document named "NumAnal-v3.4.0" explaining how to use it, and an examples folder with code. It is a little dense.
Here's a link to the basics of how to describe a Linear Programming problem, which is beyond the scope of StackOverflow. You can find help via Google.
Here's one 8 minute video ( as of 24-Nov-2019) that might help you figure out if this is what you need.
Simplex Algorithm Explanation (How to Solve a Linear Program)
https://www.youtube.com/watch?v=RO5477EKlXE

Am I using PCA in Orange in a correct way?

I am analysing if 15 books can be grouped according to 6 variables (of the 15 books, 2 are written by an author, 6 by an other one, and 7 by an other one). I counted the number of occurrences of the variables and I calculated the percentage. Then I used Orange software to use PCA. I uploaded the file. selected the columns and rows. And when it comes to PCA the program asks me if I want to normalize the data or not, but I am not sure about that because I have already calculated the percentage - is normalize different from calculating the percentage? Moreover, below the normalize button it asks me to show only:... and I have to choose a number between 0 and 100 but I don’t really know what it is.
Could you help me understand what I should do? Thank you in advance

Finding cheapest values from a user input for a product

recently I was given a word problem where I had to write a program that takes a user input of the number of a product and the finds the cheapest way the user can buy the amount of that product. Values are as follows: product 1 is a 24 pack that sells for $109, product 2 is a 12 pack that sells for $55, product 3 is a 4 pack that sells for $19, and product 4 is a 1 pack that sells for $5. The program should tell the user the cheapest way to buy the product.
Okay, if it is an explanation you need.
you want to first work out your average price per unit, this means doing $109/24, $55/12 and $19/4. This should give you different values for each individual unit.
Next Assume you want to buy x Units, you need to take x and find the package with lowest cost, see if x is greater than that values. So for example, if x is 21, then the 24pack would not be an option. EDIT here, your question do not specify, but if x is 23 and 24 pack happens to be cheaper than any other combination, would you be allowed to purchase the 24 pack? If so, for stage 4, you want to always consider going for the bigger package to see if it is cheaper, you need to add an extra decision there.
If x is greater than the cheapest package, you want to do x mod package size. Where the mod stands for modulo divide.
If x is not greater than the cheapest package, you want to take the next cheapest package size and see if x is greater than it.
You continue to loop back and forth step 3 and 4, until there are no smaller options (unless you also happen to sell them individually, in which case, you would use it).
and finally you add up all your packages * package price
=========================================================
Method 2, you can consider a combination problem, your goal is to combine any number of 24,12,4 packs and combine them to form your desired unit x. Then work out which one is cheapest. What is interesting is that if you allow buying more then you need (given that it is cheaper), you need to add a set of combinations to those generated and compare their prices. For example if x is 35, you want to run possible combinations for 48 (24*2), 36 (3*12) as well as 35.