Can anyone help me with my Computer science homework? its soo hard! omg
It's In Java, I use JE Creator, Please help me if you can. this is like my last project between me passing dudes!
Here it is
even if you do one part I would be blessed!
Part 1 (18 points): Implement a class Gradebook.
a) A Gradebook object will have a course name, total points earned, and total points possible. All points will be whole numbers.
b) When a Gradebook object is constructed the course name will be provided by the user. The total points earned and total points possible should be set to zero.
c) Create a static method named disclaimer that will print the words "This program is just a tool, please consult your instructor to verify your course grade."
d) Create a method that will return the course name.
e) Create a method that will return the points earned.
f) Create a method that will return the points possible.
Part 2 (13 points): Create a tester program to test the Gradebook class.
a) In your tester program create a method called banner that will print your name.
b) Call your banner method twice.
c) Prompt the user for the course name, and then construct a Gradebook object with that name.
d) Use a method from the Gradebook class to print the course name.
e) Use a method from the Gradebook class to print the points earned.
f) Use a method from the Gradebook class to print the points possible.
g) Run your program to verify it is working.
Part 3 (20 points): Add some points!
a) Add a method that will add points to both the points earned and the points possible.
b) Modify your tester program to prompt the user for the points earned on an assignment.
c) Modify your tester program to prompt the user for the points possible on an assignment.
d) Call the method you wrote to add these points to the Gradebook object.
e) Use a method from the Gradebook class to print the points earned.
f) Use a method from the Gradebook class to print the points possible.
g) Add another grade (repeat steps b – f).
h) And again .. (repeat steps b – f).
i) Run your program to verify it is working.
Part 4 (8 points): Find the average.
a) Add a method that will return the average (total points earned divided by total points possible).
b) Modify your tester program to print the average.
c) Run your program to verify it is working.
Part 5 (12 points): Find letter grade.
a) Add a method that will return the letter grade. (Use the standard grading scale discussed in class.)
b) Modify your tester program to print the letter grade earned.
c) Call your banner method again.
d) Run your program to verify it is working.
Part 6 (9 points): Read from a file
a) Use Save As to save a copy of tester program with the words FromFile appended to the end. (i.e. GradebookTesterFromFile).
b) Change the name of the class to match your file name.
c) Add the following import statement just under your Scanner import statement: import java.io.*;
d) Add the words throws IOException to the header of the main method. Like this:
public static void main(String [] args) throws IOException
e) Replace the System.in parameter to your scanner object with new File("grades.txt") like this:
new Scanner(new File("grades.txt"));
f) Comment out all of your input prompts (//).
g) Save and build your file.
h) Create a new text file named gradest.txt in the same folder as your java source code. (Not java file, a text file). Like this: File, New, File, Other, Text, Next, input.txt, Finish.
i) On the first line of the grades.txt file enter course name you would have normally typed at the prompt.
j) On the next 3 lines enter in pairs the earned points and possible points. For example:
90 100
85 90
10 15
k) Save the grades.txt file. Be sure it is in the same folder as your java files.
l) Run your program to verify it is working.
Part 7 (Tricky Bonus- worth up to 8 points if you complete parts 1 – 6.):
Add another method
a) Use Save As to save a copy of FromFile tester program with the words PlusMethod appended to the end. (i.e. GradebookTesterFromFilePlusMethod).
b) Add a static method to this file that will get the earned points, the possible points and then add them to an object that is passed to the method.
c) Run your program to verify it is working.
I'm not going to do your homework for you, but I will assist you in getting there. I've been studying computer and game programming for over three years now. PM me and we will do this there.
I really don't think this is the appropriate place.
Thank you.
"A Gradebook object will have a course name, total points earned, and total points possible. All points will be whole numbers."
OK, so make a new class, call it "Gradebook", and give it 4 fields. Three integer, one string. Then make 4 getter, and 4 setter method stubs.
"When a Gradebook object is constructed the course name will be provided by the user. The total points earned and total points possible should be set to zero."
Write your constructor method.
"Create a static method named disclaimer that will print the words "This program is just a tool, please consult your instructor to verify your course grade.""
Umm... if you can't do this, step away from the computer, as you should not be passing a course such as this...
Code:
public static void disclaimer()
{
System.out.println("This program is just a tool, please consult your instructor to verify your course grade.");
}
"Create a method that will return the course name", and the other two like it...
Remember I told you to make getter and setter methods. If you did that, you have already done this...
There you go, that took about 5 minutes Rest of project should take no more than about 30 minutes, I'd say
Hey i wanted to thank you even though this is old. Thank you.
Sent from my XT1056 using xda app-developers app
I'm sure many users here have heard of or currently use Reddit, the link aggregation website. If you use the website for news, to find funny jokes, to find awesome tips, etc. then you'll be happy to know that Reddit offers the ability to read data from its subreddits in the form of a JSON feed, and using Tasker we can process this feed to get the data that we want, in this case the titles of each thread. In my setup, I'm taking a random title among the top 3 posts of the day from /r/quotes.
Instructions
Variables --> Variable Set. Name %subreddit to the name of a subreddit you would like to pull from.
Variables --> Variable Set. Name %numposts to whatever number of posts you want to pull before randomizing which one is picked.
Net --> HTTP Get. The Serverort you'll be grabbing is:
Code:
json.reddit.com/r/%subreddit/top/?sort=top&t=day
Code --> Javascriptlet. Here is the Javascriptlet you'll need to put under Code.
Code:
var arr = JSON.parse(global("HTTPD"));
var randomnumber = Math.floor((Math.random()*numposts)+1);
var selftext = arr.data.children[randomnumber].data.selftext
var title = arr.data.children[randomnumber].data.title
Variables --> Variable Clear. Set Name to %HTTPD* and check Pattern Matching.
Alert --> Say. For the text, you can say anything to preface what Tasker is about to put out. For instance, I've said it to "Your quote of the day is: %title." This should change depending on which subreddit you pull from.
That's it! Pretty simple to start with. You can change the Javascriptlet to pull N number of threads into an array and mess with that if you would like. Tasker's Javascriptlet user guide is a great resource for this.
Would you mind posting the xml file? Thanks!
Did exactly as you said and it doesn't work.
Edit : Darn this is a pretty old thread
Sent from my Honor 6X using XDA Labs
Hello.
I have a tasker profile that's not quite working as I want it to, trying to get a screenshot method working because the buttons on my phone aren't reliable
(Task) 1: Run shell ~ Command screencap -p /sdcard/screenshots/screengrab-%DATE-%TIME.png
Use root (ticked)
2: Flash "Saved!"
It works, but I have to wait awhile before screenshotting again. If I want to take two screenshots in a row, the first one will save, the other won't. Seems like it's affected by what minute it is.... if it's 5:16 on the first screenshot, and 5:16 on the second, the second won't save. But if it's 5:16 on the first screenshot, and 5:17 on the second, it works. Is there something I need to add after %TIME so I'm not limited, or is this not a fixable issue?
This may not seem like a big deal for many people but sometimes I take screenshots of important emails, payment receipts, etc, sometimes they're too big to fit all on one screen and need 2 or 3 screenshots.
May or may not be relevant, but my phone is on 6.0 and stock ROM.
Bump
Found someone else with the problem I was having, adding %TIMES seems to have solved it.
Cinderbunny said:
Found someone else with the problem I was having, adding %TIMES seems to have solved it.
Click to expand...
Click to collapse
Hi,
Glad that you solved it. Just a friendly tip: to be able to save multiple (999, to be exact) screenshots per second, you could add %TIMEMS instead of %TIMES.
Additionally, if you want the actual, human-readable time in the filename, you could use the following task:
Code --> Java Function
Class Or Object: Date
Function: new {Date} (long)
Param (long): %TIMEMS
Return {Date}: date
Code --> Java Function
Class Or Object: SimpleDateFormat
Function: new {SimpleDateFormat} (String)
Param (String): yyyyMMdd-HHmmssSSS
Return {SimpleDateFormat}: formatter
Code --> Java Function
Class Or Object: formatter
Function: format {String} (Date)
Param (Date): date
Return {String}: %datetime
Code --> Run Shell
Command: screencap -p /sdcard/screenshots/screengrab-%datetime.png
Use Root: ticked
I hope this is of use to you, or anyone!
Hello.
I want to remove the last 3 characters of a variable.
Was thinking of
A1. Test Variable: %variable
Type: Length
Store Result In: %length
A2. Variable Subtract: %length Value: 3
But then in Variable Section I don't find a way for saying that I want the character from 1 to %length of %variable (in Length seems I can only set a number).
How can I do it?
Thanks.
Also in Variable Subtract action would be useful to have the Value given by a variable, but I can't see it neither
Found out: it was being in Beginner mode.
Unchecked that I can use a varibale both in Variable Subtract and in Variable Section
Hello together,
this is a little, yet, in my opinion, useful profile(s) to check for Kernel or Rom Updates on XDA (or any other web page).
The profile is set-up easily and doesn't need much effort or experience to achieve the desired automatic updater. Some values can be adjusted to your liking, but more about that in the following text.
Without further ado:
Kernel/Rom Update Profile(s)
1. Tasker Profile
Name it "Rom (or Kernel) Update". Trigger: "Time" From 08:00 every 2h til 22:00 [values adjustable]
1.1 Tasks
Add Task under "Network" called "HTTP Get"
Serverort: [copy/paste the URL of the site of the Kernel/Rom]
Timeout: 30
Mime Type: text/html
1.2. Variable Split
Name: %HTTPD
Splitter: for example "[ROM]". Whatever the value before the Kernel/Rom version number might be. In my example the thread title is: "[KERNEL] CleanSlate Kernel v1.7.7 [Wireguard][LED]..." the Splitter would be [KERNEL]
1.3 Variable Split
Name: % HTTPD2
Splitter: in this example "[Wireguard] or whatever stands behind the Kernel/Rom version number
1.4 Notify
Title: Rom(Kernel) Update available! [text adjustable]
Text: %HTTPD21
Search for an update look-alike icon for this notification
If: %HTTPD21 !~ %ROM (If your profile is for a Rom take this. If your profile is for a kernel replace the variable %ROM with %KERNEL)
1.5 Variable Set
Name: %ROM (For Rom) / %KERNEL (for Kernel)
To: %HTTPD21
And that's it! Tasker will now check for updates as often as you set the repetition in the profile trigger (e.g. every 2 hours).
Note: Let the Task run once for the variables to set up. If everything worked you will have a notification in your notification area, because %ROM/%KERNEL at the moment missmatches %HTTPD21. Clear that notificaion and then you're good to go.
But that's not about it. Additionally I have set up a hyperlink to the notification, which will take you to the Kernel/Rom Thread. I'll show you in Step 2, but that's only additionally.
Step 2 - Notification link
2. Create a 2nd profile. Trigger: Clicked notification.
Application owner: Tasker
Title: In this example "Rom(Kernel) Update available!" or whatever is the title of your tasker notification in step 1.4
2.1 Task "Call URL"
URL: [The URL of the Kernel/ROM] (Same like in 1.1)
Done! If you now click on the update notifcation you will be taken to the URL of your Kernel or ROM
Feel free to share and ask questions, if something still remained unclear. I tried to format and explain as best as I can
Follow_and_Feel said:
Serverort: [copy/paste the URL of the site of the Kernel/Rom]
Timeout: 30
Mime Type: text/html
Click to expand...
Click to collapse
For 1.1, for the task Action, which should it be? I assume that the app has changed some things since you posted this, but I'm assuming the Action Category should be Net? And if this is correct, which Net category should it be?
This would be an incredibly useful task! Thank you so much!
JKforUA said:
For 1.1, for the task Action, which should it be? I assume that the app has changed some things since you posted this, but I'm assuming the Action Category should be Net? And if this is correct, which Net category should it be?
This would be an incredibly useful task! Thank you so much!
Click to expand...
Click to collapse
Hey there. No it hasn't changed at all. You need to go into the "Tasks" section to add a task and name it to your liking. Then click the little "+" sign at the bottom right and then it's under "network" --> "HTTP Get". Still the same as always. Hope I could help
EDIT: But I see now what you mean! I forgot to mention which task it is. Already edited, thank you
Follow_and_Feel said:
Hey there. No it hasn't changed at all. You need to go into the "Tasks" section to add a task and name it to your liking. Then click the little "+" sign at the bottom right and then it's under "network" --> "HTTP Get". Still the same as always. Hope I could help
EDIT: But I see now what you mean! I forgot to mention which task it is. Already edited, thank you
Click to expand...
Click to collapse
Haha, yeah, that's what I was confused about. I'm a newb when it comes to Tasker, so I was wondering if I somehow was just missing something haha. Thanks so much!
JKforUA said:
Haha, yeah, that's what I was confused about. I'm a newb when it comes to Tasker, so I was wondering if I somehow was just missing something haha. Thanks so much!
Click to expand...
Click to collapse
No problem buddy. Totally goes on me If you need any further assistance don't hesitate to ask
Follow_and_Feel said:
No problem buddy. Totally goes on me If you need any further assistance don't hesitate to ask
Click to expand...
Click to collapse
Well, if I had a little more experience with Tasker, I would have known what you meant to begin with, but thanks!
ONE more question... for the Variable Split in 1.2 and 1.3. I'm wanting to set this up to get updates for the Nitrogen ROM for the Pixel 2 XL ( https://forum.xda-developers.com/pi...m-nitrogen-os-oreo-substratum-12-feb-t3748293 ). The thread title is:
[ROM] ► [8.1.0_r40] ► [taimen] ► Nitrogen OS Oreo ► Substratum ► (04.July.2018)
Would the splitter for 1.2 be [ROM] and the splitter for 1.3 be [taimen]? Thanks so much for any help!!
Most Tasker profiles/tasks I've seen aren't really that useful for me since most of the things are already included in one way or another with the Pixel 2 or other apps, but this one would be so useful to have! Genius, man.
JKforUA said:
Well, if I had a little more experience with Tasker, I would have known what you meant to begin with, but thanks!
ONE more question... for the Variable Split in 1.2 and 1.3. I'm wanting to set this up to get updates for the Nitrogen ROM for the Pixel 2 XL ( https://forum.xda-developers.com/pi...m-nitrogen-os-oreo-substratum-12-feb-t3748293 ). The thread title is:
[ROM] ► [8.1.0_r40] ► [taimen] ► Nitrogen OS Oreo ► Substratum ► (04.July.2018)
Would the splitter for 1.2 be [ROM] and the splitter for 1.3 be [taimen]? Thanks so much for any help!!
Most Tasker profiles/tasks I've seen aren't really that useful for me since most of the things are already included in one way or another with the Pixel 2 or other apps, but this one would be so useful to have! Genius, man.
Click to expand...
Click to collapse
Sorry for the delay, was a little busy. So: Yes. That would be the splitters for your specific ROM :highfive:
Follow_and_Feel said:
Sorry for the delay, was a little busy. So: Yes. That would be the splitters for your specific ROM :highfive:
Click to expand...
Click to collapse
No worries about the 'delay'. I wasn't expecting an answer for a while since it is during work hours lol. Thank you so much!!!!!
JKforUA said:
No worries about the 'delay'. I wasn't expecting an answer for a while since it is during work hours lol. Thank you so much!!!!!
Click to expand...
Click to collapse
Over here it's 22.42 so I'm not working atm anyway hehe If you wish to speed things up a little we could have a private conversation and I'll help you personally with setting it up (having in mind, that you're new to tasker) or, if you have Telegram, have a chat over there But only if you don't wanna try yourself
Follow_and_Feel said:
Over here it's 22.42 so I'm not working atm anyway hehe If you wish to speed things up a little we could have a private conversation and I'll help you personally with setting it up (having in mind, that you're new to tasker) or, if you have Telegram, have a chat over there But only if you don't wanna try yourself
Click to expand...
Click to collapse
I'm a software engineer, so I'm not exactly an amateur with stuff like this lol, but there does seem to be a learning curve with Tasker. Thanks for helping everybody out. I will just post what I got from the 'Description in Email' function, and if you don't mind, you could just glance over it to make sure I've got everything correct. I'll post this in public so that it might help somebody else trying to learn how to do this. I used different values for when to make checks to see if there is an update. Otherwise, I left everything as default except for the specific values you say to add/change in each action (a little hard to test since I don't know when there will be another update for the Nitrogen ROM):
Profile: ROM update (3)
Time: 11:08AM
Enter: Anon (6)
A1: HTTP Get [ Serverort:https://forum.xda-developers.com/pi...m-nitrogen-os-oreo-substratum-12-feb-t3748293 Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type:text/html Output File: Trust Any Certificateff ]
A2: Variable Split [ Name:%HTTPD Splitter:[ROM] Delete Baseff ]
A3: Variable Split [ Name:%HTTPD2 Splitter:[taimen] Delete Baseff ]
A4: Notify [ Title:ROM Update For Nitrogen Available Text:%HTTPD21 Icon:cust_star Number:0 Permanentff Priority:3 ] If [ %HTTPD21 !~ %ROM ]
A5: Variable Set [ Name:%ROM To:%HTTPD21 Recurse Variablesff Do Mathsff Appendff ]
JKforUA said:
I'm a software engineer, so I'm not exactly an amateur with stuff like this lol, but there does seem to be a learning curve with Tasker. Thanks for helping everybody out. I will just post what I got from the 'Description in Email' function, and if you don't mind, you could just glance over it to make sure I've got everything correct. I'll post this in public so that it might help somebody else trying to learn how to do this. I used different values for when to make checks to see if there is an update. Otherwise, I left everything as default except for the specific values you say to add/change in each action (a little hard to test since I don't know when there will be another update for the Nitrogen ROM):
Profile: ROM update (3)
Time: 11:08AM
Enter: Anon (6)
A1: HTTP Get [ Serverort:https://forum.xda-developers.com/pi...m-nitrogen-os-oreo-substratum-12-feb-t3748293 Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type:text/html Output File: Trust Any Certificateff ]
A2: Variable Split [ Name:%HTTPD Splitter:[ROM] Delete Baseff ]
A3: Variable Split [ Name:%HTTPD2 Splitter:[taimen] Delete Baseff ]
A4: Notify [ Title:ROM Update For Nitrogen Available Text:%HTTPD21 Icon:cust_star Number:0 Permanentff Priority:3 ] If [ %HTTPD21 !~ %ROM ]
A5: Variable Set [ Name:%ROM To:%HTTPD21 Recurse Variablesff Do Mathsff Appendff ]
Click to expand...
Click to collapse
Okay no problem. I think I can't fully follow you atm. What do you mean by "Description in Email" function? Is this a tasker function? Anyways here's what I can tell so far about:
A1: Leave everything blank except MimeTYPE, Timout (10-30 scnds) and, of course, the link to the ROM.
A2/A3: No deleting bases here. No, sit!
A4: Seems fine at first glance
A5: Not a recursive variable, not mathematic. Just stay straight to the description in the OP.
That's what I can tell so far, even though I don't quite know what you've done, since there's a lot of s in it
And one important hint:
You can test your profile (and therefore "fake" that there is a new update) if you set "HTTPD21" in the variable section of your task to any other value. If things work with your profiles there will be an android notification. If not there definately is something messed up. And secondly: Did you run the task once? I mean the entire task "1." from the op? As I stated in red letters you have to run it once in order to make it work, since variables will only be set after the task has run once. Hope this helps in any way and yes. First things with tasker are pretty complicated, that's, I guess, how everybody new to this app feels when coming in touch with it Cheers!
@JKforUA As I just checked the source code for your ROM:
Try splitters "658; [" for the first splitter and "] `" for the 2nd. This should soak in the ROM version perfectly
Follow_and_Feel said:
@JKforUA As I just checked the source code for your ROM:
Try splitters "658; [" for the first splitter and "] `" for the 2nd. This should soak in the ROM version perfectly
Click to expand...
Click to collapse
As for what I was talking about with the "Description by Email" function, this is what I was talking about: In the 'Profiles' screen, if you long press on one of the profiles and then press the 3 dots in the top right hand corner, there is an 'Export' option where you can get a copy of the profile/task in "Description" or "XML" format. What I copied/pasted was the "Description" of the profile. For A1, it just printed out every option given (but I didn't set anything other than what you say in the OP). A2 and A3, I don't have 'Delete Base' selected, but I guess the export still printed out the parameters. Don't worry lol. Likewise with A5. Surely there is a better way to export or copy a profile/task that will leave out all of the parameters that aren't set to anything. I'll look into that later tonight...
I just tried this with the two splitters you suggested and this is the error I got on my 3rd task (the second splitter). I'll have to wait until I'm home in a little bit to look into this. Looks like HTTPD2 isn't getting set, but I'll check it out in a little bit.:
16.58.50/Variables doreplresult: |%HTTPD2| -> |%HTTPD2|
16.58.50/E Variable Split: %HTTPD2 -> %HTTPD2
16.58.50/Variables doreplresult: |%HTTPD2| -> |%HTTPD2|
16.58.50/E Variable Split: can't split unset value to set %HTTPD2
16.58.50/E result: stop task (error)
16.58.50/Variables doreplresult: |%HTTPD2| -> |%HTTPD2|
16.58.50/E Error: 1
16.58.50/MacroEdit action finished exeID 1 action no 2 code 590 status: Err next 2
Thank you so much for 'holding my hand' through this lol. I'm learning a lot from this.
JKforUA said:
As for what I was talking about with the "Description by Email" function, this is what I was talking about: In the 'Profiles' screen, if you long press on one of the profiles and then press the 3 dots in the top right hand corner, there is an 'Export' option where you can get a copy of the profile/task in "Description" or "XML" format. What I copied/pasted was the "Description" of the profile. For A1, it just printed out every option given (but I didn't set anything other than what you say in the OP). A2 and A3, I don't have 'Delete Base' selected, but I guess the export still printed out the parameters. Don't worry lol. Likewise with A5. Surely there is a better way to export or copy a profile/task that will leave out all of the parameters that aren't set to anything. I'll look into that later tonight...
I just tried this with the two splitters you suggested and this is the error I got on my 3rd task (the second splitter). I'll have to wait until I'm home in a little bit to look into this. Looks like HTTPD2 isn't getting set, but I'll check it out in a little bit.:
16.58.50/Variables doreplresult: |%HTTPD2| -> |%HTTPD2|
16.58.50/E Variable Split: %HTTPD2 -> %HTTPD2
16.58.50/Variables doreplresult: |%HTTPD2| -> |%HTTPD2|
16.58.50/E Variable Split: can't split unset value to set %HTTPD2
16.58.50/E result: stop task (error)
16.58.50/Variables doreplresult: |%HTTPD2| -> |%HTTPD2|
16.58.50/E Error: 1
16.58.50/MacroEdit action finished exeID 1 action no 2 code 590 status: Err next 2
Thank you so much for 'holding my hand' through this lol. I'm learning a lot from this.
Click to expand...
Click to collapse
I'm with you mate So, what came to my mind when reading your reply is: In the OP, this is all ONE big task and you should have bullet points 1.1-1.5 in a single task, in a single profile (which would be "1." - Repeat from xx - til xx). That's not what might cause the problems, since the variables are global, but it's for the aesthetics (If I'm right with the several tasks).
Besides that I really think some screenshots could be of tremendous help, since it's hard to comprehend what causes the errors, if I don't see exactly how you've set it up. To get to the root of the problem I suggest you send me 3 screenshots next:
1. Overview of the profile(s)
2. The task itself in overview. However you named the task: Click on it and then take a screenshot
3. Most important for me to comprehend: Overview of the variables. This is in the variable section either on tasker's home screen or in this "Check for ROM/KERNEL update" tab. If I can see how the variables are stored in combination with the other 2 shots I might figure out problems pretty quickly.
Do that and I'm sure we'll get this straight
P.S.: Don't panic if I suddenly won't reply anymore. It's past midnight here and I might have fallen asleep, but I'll get back to you tomorrow
Guide
Thanks
Hi all,
Thx a lot for this great idea, I can follow the kernel version. [emoji106]
For the Rom, it's different, because the thread title doesn't contain the version number.
Title is "ResurrectionRemix ROM 6.1.0 - Official Weeklies- 8.1.0 by*alex9yust" ( https://forum.xda-developers.com/redmi-note-3/development/rom-resurrectionremix-5-8-0-t3507433 )
An idea could be to check the name of last file on the Rom page (https://sourceforge.net/projects/resurrectionremix-oreo/files/kenzo/), but I don't know if it's possible.
Do you have another idea ?