Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › HELP DESPERATELY NEEDED!
New Posts  All Forums:Forum Nav:

HELP DESPERATELY NEEDED!

post #1 of 8
Thread Starter 
I am taking this programming class, which is required by my major. I dont even know the ABC's of programming! So this assignment will determine if i pass this class or not. PLZ PLZ PLZ PLZZZ kindly help!

Here is the assignment:-

Write a class names car that has the following data attributes:

--year_model (for the car's year model)
--make(for the make of the car)
--speed(for the car's curent speed)

The car class should have an --init--method that accecpt the car's year model and make as arguments. These values should be assigned to the object's__year__model and __make.

This class should also have the following methods:

-accelerate
the accelerate method should add 5 to the speed data attribute each time it is called

-brake
the brake method should subtract 5 from the speed data attribute each time it is called.

-get_speed
The get_speed method should return the current speed

Next, design a program that creates a car object, and then calls the accelerate method five times. After each call to the accelerate method, get the current speed of the car and display it. Then call the brake method five times. After each call to the brake method, get the current speed of the car and display it.


Please guys, think about the moment when you really needed help and no one was helping you, i am at the same point of life. I really need to graduate this semester and this class is the only class holding me back. Plz kindly help!
post #2 of 8
Most people here are willing to help those that contribute to the situation yourself. This problem is fairly simple and easy to accomplish if you attempt the problem. I will be more than happy to help you if you reply with a non working solution that you have questions about. If you choose not to do such, good luck with graduation.
Work in Progress
(15 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-8350 BE Vishera GIGABYTE 990FXA SAPPHIRE FleX-2 7950 G.SKILL Ripjaws X Series 
Hard DriveOptical DriveCoolingOS
OCZ Vertex 4 HP 20X DVD±R DVD Burner CORSAIR H100i Windows 8 
MonitorMonitorKeyboardPower
22in Widescreen Samsung 24in Widescreen Asus Microsoft Corsair 650TX 
CaseMouse
Corsair Vengeance C70 in Gunmetal Black Logitech G700 
  hide details  
Reply
Work in Progress
(15 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-8350 BE Vishera GIGABYTE 990FXA SAPPHIRE FleX-2 7950 G.SKILL Ripjaws X Series 
Hard DriveOptical DriveCoolingOS
OCZ Vertex 4 HP 20X DVD±R DVD Burner CORSAIR H100i Windows 8 
MonitorMonitorKeyboardPower
22in Widescreen Samsung 24in Widescreen Asus Microsoft Corsair 650TX 
CaseMouse
Corsair Vengeance C70 in Gunmetal Black Logitech G700 
  hide details  
Reply
post #3 of 8
Thread Starter 
Ike-

I am definately not one of those ppl who likes to get the work done. Infact this is the first time i have posted something online like this. Only If i knew how to do it, i would have done it on my own. The truth of the matter is that all i know about programming is to type "main()" at the end...:S
Thanks for responding anyway! but plz any help would be appreciated..atleast helping me start out?
post #4 of 8
You aren't going to learn anything at all if you come to a forum asking us to do your assignments for you. As of yet you haven't shown that you've done any work towards even attempting the problem at hand, and as such not many people will be inclined to do it for you. However you did ask for a push in the right direction. I would start with this, assuming it's in C
Code:
int main(int argc, char ** argv)
{
    return 0;
}
Felix
(11 items)
 
ESXi 1
(9 items)
 
Dexter
(12 items)
 
CPUMotherboardGraphicsRAM
Intel Core i7 3770S 3.1 GHz Socket 1155 Box  Intel DQ77KB Intel HD4000 integrated gpu STRONTIUM 8GB Sodimm Single DDR3 1600Mhz 
Hard DriveCoolingOSKeyboard
Intel 520 Series SATA3 25nm 120G 2.5' Scythe Kozuti CPU low profile heatsink fan Microsoft Windows 8 Pro w/ Media Centre Corsair Vengeance K90. Performance, MMO, Mechan... 
PowerCaseMouse
Dell 19V 4.62A (Round) PA-10 Original AC Adapter Antec ISK110 VESA Mini-ITX Case, 90-watt adapte... Corsair Vengeance M90. Performance, MMO, Mechan... 
CPUMotherboardGraphicsRAM
Intel Core i7 3770 3.40 GHz 8M LGA1155 Processor Intel DQ77MK Intel HD4000 integrated gpu STRONTIUM 8GB 1600MHz DDR3 Dimm Single Module P... 
Hard DriveCoolingOSCase
SanDisk Blade 4GB Scythe Big Shuriken Rev. 2 ESXi vSphere 5.1 Coolermaster Elite 343 MATX Mini Tower Case Bla... 
Other
Dell X3959 dual port Intel GbE NIC 
CPUMotherboardGraphicsRAM
Intel Ivy Bridge Core i7 3770K Unlocked Quad Core ASUS SABERTOOTH-Z77 PCI-E3.0 x 16 Motherboard Intel HD4000 integrated gpu Corsair Vengeance 16GB (4x4GB) DDR3 1600MHz CL9... 
Hard DriveHard DriveCoolingCooling
Western Digital Scorpio Black 2.5 inch 320GB Western Digital Caviar Raid Edition4 1000GB (1TB) Corsair Cooling Hydro Series H100 Liquid CPU Corsair "Air Series" SP120 Quiet Edition Case Fan 
OSPowerCaseOther
Openfiler 2.99-2 Corsair AX850 850W  Corsair Obsidian 650D Black Mid Tower Case with... Dell Perc 6/i RAID Controller 
  hide details  
Reply
Felix
(11 items)
 
ESXi 1
(9 items)
 
Dexter
(12 items)
 
CPUMotherboardGraphicsRAM
Intel Core i7 3770S 3.1 GHz Socket 1155 Box  Intel DQ77KB Intel HD4000 integrated gpu STRONTIUM 8GB Sodimm Single DDR3 1600Mhz 
Hard DriveCoolingOSKeyboard
Intel 520 Series SATA3 25nm 120G 2.5' Scythe Kozuti CPU low profile heatsink fan Microsoft Windows 8 Pro w/ Media Centre Corsair Vengeance K90. Performance, MMO, Mechan... 
PowerCaseMouse
Dell 19V 4.62A (Round) PA-10 Original AC Adapter Antec ISK110 VESA Mini-ITX Case, 90-watt adapte... Corsair Vengeance M90. Performance, MMO, Mechan... 
CPUMotherboardGraphicsRAM
Intel Core i7 3770 3.40 GHz 8M LGA1155 Processor Intel DQ77MK Intel HD4000 integrated gpu STRONTIUM 8GB 1600MHz DDR3 Dimm Single Module P... 
Hard DriveCoolingOSCase
SanDisk Blade 4GB Scythe Big Shuriken Rev. 2 ESXi vSphere 5.1 Coolermaster Elite 343 MATX Mini Tower Case Bla... 
Other
Dell X3959 dual port Intel GbE NIC 
CPUMotherboardGraphicsRAM
Intel Ivy Bridge Core i7 3770K Unlocked Quad Core ASUS SABERTOOTH-Z77 PCI-E3.0 x 16 Motherboard Intel HD4000 integrated gpu Corsair Vengeance 16GB (4x4GB) DDR3 1600MHz CL9... 
Hard DriveHard DriveCoolingCooling
Western Digital Scorpio Black 2.5 inch 320GB Western Digital Caviar Raid Edition4 1000GB (1TB) Corsair Cooling Hydro Series H100 Liquid CPU Corsair "Air Series" SP120 Quiet Edition Case Fan 
OSPowerCaseOther
Openfiler 2.99-2 Corsair AX850 850W  Corsair Obsidian 650D Black Mid Tower Case with... Dell Perc 6/i RAID Controller 
  hide details  
Reply
post #5 of 8
I would suggest if you have the time, head to your college library or computer lab and ask for some assistance there, too. Normally, there are people in the computer lab who have programming experience.
post #6 of 8
This seems like a fairly simple program, first step would be to tell us what language you're using. My best guess would be Java. In this case I suggest reading up on objects since in this case you're making a car class aka object which takes several inputs that will identify it.

Good luck.

Sent from my Galaxy Nexus using Tapatalk 2
T3k
(13 items)
 
The Tibaldi
(9 items)
 
WooJoo
(13 items)
 
CPUMotherboardGraphicsGraphics
Intel i5 3210 h77 HD4000 GeForce 640 LE 
RAMHard DriveOSOS
4gb of something 5400rpm slowness 13.04 Ubuntu x64  Windows 8 Pro 
Monitor
1920x1080 
CPUMotherboardGraphicsRAM
965 BE 4.0GHZ (250 x 15.5) @1.5V m2n32 sli deluxe - 2000mhz @ 1.3V Asus TOP 5850 1GB 950/1200 Kingston HyperX 5-5-5-15 
Hard DriveOptical DriveOSMonitor
WD Velociraptor 150GB, WD raptor 74gb TDK 880N DVDRW Windows 7 x64 Ultimate Westinghouse 22" lcd 
KeyboardPowerCaseMouse
saitek eclipse II Corsair 620W modular Cooler Master ATCS 840 black emprex 
  hide details  
Reply
T3k
(13 items)
 
The Tibaldi
(9 items)
 
WooJoo
(13 items)
 
CPUMotherboardGraphicsGraphics
Intel i5 3210 h77 HD4000 GeForce 640 LE 
RAMHard DriveOSOS
4gb of something 5400rpm slowness 13.04 Ubuntu x64  Windows 8 Pro 
Monitor
1920x1080 
CPUMotherboardGraphicsRAM
965 BE 4.0GHZ (250 x 15.5) @1.5V m2n32 sli deluxe - 2000mhz @ 1.3V Asus TOP 5850 1GB 950/1200 Kingston HyperX 5-5-5-15 
Hard DriveOptical DriveOSMonitor
WD Velociraptor 150GB, WD raptor 74gb TDK 880N DVDRW Windows 7 x64 Ultimate Westinghouse 22" lcd 
KeyboardPowerCaseMouse
saitek eclipse II Corsair 620W modular Cooler Master ATCS 840 black emprex 
  hide details  
Reply
post #7 of 8
For Gaming
(18 items)
 
For Working
(8 items)
 
For Serving
(8 items)
 
CPUMotherboardGraphicsRAM
AMD FX-8350 @ 4.6 Ghz ASUS M5A97-PRO Sapphire R9 290X Tri-X 4GB @ 1170/1475 8GB Corsair Vengeance Blue LP DDR3 2133 Mhz 
Hard DriveHard DriveOptical DriveCooling
Crucial M4 SSD 128 GB Toshiba SATA III 2TB SAMSUNG DVDRW Corsair H60 
OSMonitorKeyboardPower
Windows 10 Pro 64 Bit Asus MG279Q 27" FreeSync WQHD 144hz IPS Corsair K70 LUX RGB Cherry MX Red Corsair CX750M 
CaseMouseAudioAudio
Cooler Master Elite 430 Corsair Vengeance M65 Alesis iO2 Express Audio Interface Wharfedale Pro Diamond 8.2 Active Studio Monitors 
Audio
Corsair Vengeance 1500 v2 7.1 Dolby Headset 
CPUGraphicsRAMHard Drive
Intel Core i7-3740QM CPU @ 2.70 Ghz NVidia Quadro K1000M 2GB 32GB DDR3 500GB 7200RPM 
Optical DriveOSMonitorOther
Slot DVDRW Windows 7 64-Bit 1080p Built in Display Dell Precision M4700 
  hide details  
Reply
For Gaming
(18 items)
 
For Working
(8 items)
 
For Serving
(8 items)
 
CPUMotherboardGraphicsRAM
AMD FX-8350 @ 4.6 Ghz ASUS M5A97-PRO Sapphire R9 290X Tri-X 4GB @ 1170/1475 8GB Corsair Vengeance Blue LP DDR3 2133 Mhz 
Hard DriveHard DriveOptical DriveCooling
Crucial M4 SSD 128 GB Toshiba SATA III 2TB SAMSUNG DVDRW Corsair H60 
OSMonitorKeyboardPower
Windows 10 Pro 64 Bit Asus MG279Q 27" FreeSync WQHD 144hz IPS Corsair K70 LUX RGB Cherry MX Red Corsair CX750M 
CaseMouseAudioAudio
Cooler Master Elite 430 Corsair Vengeance M65 Alesis iO2 Express Audio Interface Wharfedale Pro Diamond 8.2 Active Studio Monitors 
Audio
Corsair Vengeance 1500 v2 7.1 Dolby Headset 
CPUGraphicsRAMHard Drive
Intel Core i7-3740QM CPU @ 2.70 Ghz NVidia Quadro K1000M 2GB 32GB DDR3 500GB 7200RPM 
Optical DriveOSMonitorOther
Slot DVDRW Windows 7 64-Bit 1080p Built in Display Dell Precision M4700 
  hide details  
Reply
post #8 of 8
My Java is a bit rusty, but I'll give it a shot.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › HELP DESPERATELY NEEDED!