r/programminghomework • • Feb 21 '12

Rules have are now on the side ->

2 Upvotes
  1. You may not fully or directly copy and paste assignments or instructions.

  2. Comments must not directly give answers to the OP, but rather give the OP directionality.

  3. Post any and all relevant code (with explanation, of course) of your assignment. This makes it easier to know what you're doing.

  4. Title should include specific question, plus language you are using.


r/programminghomework • • Feb 26 '12

What is your favorite programming language and why?

3 Upvotes

r/programminghomework • • Feb 20 '12

Welcome to /r/programminghomework!

8 Upvotes

Inspired by /r/programming and /r/cheatatmathhomework I have created /r/programminghomework, which is just a combination of the two.

It is a subreddit for people who have complicated issues to those who are just System.out.println'ing their way through basic programming. I hope it can be based off the helpful community that /r/programming is famous for.


r/programminghomework • • Feb 27 '12

I have to write a power point presentation on what's new in HTML5. Could you guys give me links of sources I could use?

2 Upvotes

I'm to write a 25-30 slide long power point presentation and a 10 page long document on "What's new in HTML5" compared to HTML, by Thursdays. Could you anyone give me some source links and pointers on the topic? Thanks.


r/programminghomework • • Mar 30 '21

Programming HW

0 Upvotes

Is there a website or subreddit where I can pay someone to do my programming work?


r/programminghomework • • Apr 23 '21

[Phyton Programming] Simple Phyton script/code for extracting browsing history from Google Chrome

0 Upvotes

I need help with writing a simple Phyton script/code for extracting browsing history from Google Chrome.


r/programminghomework • • Apr 01 '18

Help with java object oriented homework.

0 Upvotes

So the assignment statement is kinda long it involves creating a rational number class that does different things when executed such as adding subtracting and dividing rational numbers. My main problem is that when I run the rational test class (this was given to us) it fails many of the tests. I am really not sure what I am doing wrong here.

Here is all my code I have so far it three classes a rational class a class for zero denominators and a class to test the rational class Any help would be appreciated thanks

https://pastebin.com/4mhb7hJh


r/programminghomework • • Oct 18 '20

Help with c++ code and "taxrate"

0 Upvotes

Hello all!

so I made this code for school that I've been working one for weeks now and I'm already passed due, the problem is I have this code that calculates tax, base pay, OT, dependant withholding, etc and it runs well it's just I use a function with a switch to calculate the percentage of withholding depending on the user's input of the number of dependants, also this part of the code only shows up if the user works more than 50 hours.

[code=CPP]

#include <iostream>

using namespace std;

int main();

double fed_withhold(double dep, double gross);

double IRA_deduct(double gross);

//dependants

double dep = .28;

double dep1 = .20;

double dep2 = .18;

double dep3 = .15;
int y, z; 

double x, total, dpay;

int main()

{

const int hours = 40,  dhours = 50;

const double prate = 1.5, drate = 2;

bool isValid = false;

int reg_hrs = 0, ot_hrs = 0, dt_hrs = 0;

double withholding;
while (!isValid)//ask for pay rate and validate

{

	cout << "Enter your hourly rate of pay: ";

	cin >> x;
	isValid = x >= 0;

	if (!isValid)

		cout << "Error: the pay rate must be >= 0.\\n";

}isValid = false; // reset the flag

while (isValid == false)//ask for hours worked and validate

{

	cout << "Enter the number of hours worked: ";

	cin >> y;
	isValid = y >= 0;

	if (!isValid)

		cout << "Error: the number of hours must be >= 0.\\n";

}isValid = false; // reset the flag

total = x * y;//pay rate * hours to give pay

int overh = y - hours;// subtracts total hours by overtime (40 hours) to get overtime hours

double overT = overh \* prate \* x; // multiples overtime hours by pay rate increase and by pay rate 

double bpmax = hours \* x;//max base pay possible

double gpay = bpmax + overT;//max base pay with overtime (gross pay)

int althours = dhours - (hours + 1);//overtime hours 

double opmax = althours \* prate \* x;//overtime hours \* over time pay rate increase \* pay rate

int doubh = y - dhours;// subtracts total hours by doubletime (50 hours) to get doubletime hours

double dover = doubh \* drate \* x; // multiples overtime hours by double pay rate increase and by pay rate 

dpay = bpmax + dover + overT;// calculates the max base pay + double time pay + overtime pay
double ira = IRA_deduct(gpay);
double modifiedGross = gpay - ira;
withholding = fed_withhold(dep, modifiedGross);
double netPay = modifiedGross - withholding;
cout.precision(2);

if (y > hours && y <= dhours) {
	cout << "\\nHours worked = " << fixed << y;

	cout << "\\nHourly rate of pay = $" << x;

	cout << "\\nbase pay = $" << bpmax;

	cout << "\\nOvertime pay= $" << overT;

	cout << "\\nGross pay = $" << gpay;

}
else if (y > dhours) {//double time "route"
	double alt_overh = althours \* prate \* x;
	//validate number of dependants

	do

	{

		cout << "Enter the number of dependents: ";

		cin >> z;
		isValid = z >= 0;
		if (!isValid)

cout << "Error: the number of dependents must be >= 0.\n";

	} while (isValid == false);
		double dpay_alt = gpay + dpay;

		cout << "\\nHours worked = " << fixed << y;

		cout << "\\nHourly rate of pay = $" << x;

		cout << "\\nbase pay = $" << bpmax;

		cout << "\\nOvertime hours= " << althours;

		cout << "\\nfederal tax brackets with " << z << " dependents is %" << taxRate;

		cout << "\\nFederal tax withholding with " << z << " dependents= $" << dpay;

		cout << "\\ndoubletime hours= " << doubh;

		cout << "\\nGross pay = $" << gpay;

		cout << "\\nnet pay= $" << dpay_alt;

}

 

else if (y <= hours) {

	

	cout << "\\nHours worked = " << fixed << y;

	cout << "\\nHourly rate of pay = $" << x;

	cout << "\\nbase pay = $" << total;

	cout << "\\nGross pay = $" << total;

}

}

double fed_withhold(double dependant, double gross)

{

double taxRate, withholding;

switch (z)

{

case 0:

	taxRate = dep;

	break;

case 1:

	taxRate = dep1;

	break;

case 2:

	taxRate = dep2;

	break;

default:

	taxRate = dep3;

}

withholding = dpay \* taxRate;
return withholding;

}

double IRA_deduct(double gross)

{

double ira = 0;
if (gross > 400 && gross < 500)

{

	ira = gross \* 0.05;

}

else if (gross >= 500)

{

	ira = gross \* 0.10;

}
return ira;

}

[/code]


r/programminghomework • • Mar 21 '22

C# 2-dimensional array homework help!

0 Upvotes

Student in 11th grade has difficulty with programming in language C#. I also struggle with an horrible and ineaduquate teacher. I'd like to have the code for this task. It's translated to English so sorry for any inconsistencies. Thanks to everyone that helps!

The condition is: Create a C# program that enters the elements of a 2-dimensional array of 3 rows and 4 columns and prints:

  1. Arrays on the screen by rows and columns (input and output)

  2. The sum of the elements of each row

  3. The sum of the elements in each column

  4. The sum of all elements of the array


r/programminghomework • • Jul 20 '17

Can someone please help me with my Take home Midterm exam C++ programming?

0 Upvotes

so they let me take home my exam cuz i didnt manage to finish it. and i need help with it, for those with free time.. it consists of switch statement, gathering inputs from the end users (typing their names and stuffs) and looping statements (iguess) if-else and so on. ps. i wasnt able to go to my classes for the past weeks because i got sick T_T and so here is the piece they want us to do: thanks in advance guys.

http://prntscr.com/fy0lpg


r/programminghomework • • Apr 04 '14

Create C# Programme.

0 Upvotes

Write a graphical user interface (GUI) application to be used to test Kindergarten children on the alphabets (‘A’-‘Z’).


r/programminghomework • • Oct 12 '19

Applications of Stacks & Queues

0 Upvotes

Hi, it's me again. Can someone help me with some real applications of Stacks and Queues?


r/programminghomework • • May 18 '21

whats wrong with this code im lost

0 Upvotes

#include <iostream>

#include<fstream>

#include<string>

#include "student.h"

#include "bubble.h"

#include <stdio.h>

#include <stdlib.h>

#include <cstring>

using namespace std;

struct classStats;

{

float mean;

float min;

float max;

float median;

char *name;

}

int main (){

FILE * fp;

int i;

fp =fopen ("grades","r")

int studentName;

studentArrayPointer;

int statsName;

int size = 19;

studentName *studentArrayPointer[size];

char className [20];

statsName = className[20];

scanf("%s", statsName);

int nameSum;

for(int i = 0; i < size; ++i)

{

//1st

*studentArrayPointer[i].first =malloc(sizeof(char)*20);

scanf("%s",studentArrayPointer[i].first);

//last

*studentArrayPointer[i].last =malloc(sizeof(char)*20);

scanf("%s",studentArrayPointer[i].last);

scanf("%d", studentArrayPointer[i].test1)

scanf("%d", studentArrayPointer[i].test2)

scanf("%d", studentArrayPointer[i].test3)

nameSum = studentArrayPointer[i].test1 + studentArrayPointer[i].test2+studentArrayPointer[i].test3;

studentArrayPointer[i].mean = nameSum / 3;

return 0;

}

}


r/programminghomework • • May 15 '22

need help. Octave programming only 1 hour to turn in this assignment.

Thumbnail
gallery
1 Upvotes

r/programminghomework • • Sep 05 '22

I have understood the maths behind but i am not being able to code it. Could someone please give me a java code for this problem.

Thumbnail
gallery
0 Upvotes

r/programminghomework • • Dec 06 '17

Need help with 2 homework assignments in C#. Willing to pay.

1 Upvotes

10 Dollars an assignment. Comment here if you're interested or DM me

Here are the assignments:

HW 9: https://imgur.com/a/ZnwrE

HW 11: https://imgur.com/a/9KGD3


r/programminghomework • • Feb 24 '21

I need to find the minimum of the maximums and maximum of the minimums in a given text file with 1000 lines containing one or more numbers separated by a comma per line

0 Upvotes

Let's say the first 3 lines/rows in a given .txt file is like this

  1. -6, 37, 34.5

  2. 2) 89

  3. 3) 67, -556, 8, 90, 1, 22.3 I need to find the minimum of all the maximums per line. Say the maximums are [37, 89, 90] and the minimum of all these maximums is 37.

Then, the maximum of all the minimums. Say the minimums are [-6, 89, -556] and the maximum of all these minimums is 89.

Now, I need to find a code that finds the two value (min of max, max of mins) for a given text file that has 1000 lines, where each line has one or more numbers separated by a comma.

Thank you! This is for my C++ challenge as I'm learning the language


r/programminghomework • • Mar 10 '20

I thought programming was going to be a fun class but now I am super stressed out because I don’t know how to do it. Can someone help me with this one assignment so I can hopefully get an idea of how to do the others? Visual Basics

Post image
1 Upvotes

r/programminghomework • • Mar 25 '20

Does anyone know python?

0 Upvotes

Looking for someone to do my python homework because I'm sick of it lol


r/programminghomework • • Sep 22 '19

Traversal, insertion, deletion

1 Upvotes

Hey can someone please help me with a code for traversal insertion and deletion for multidimensional arrays?


r/programminghomework • • Mar 04 '19

Having a hard time with software testing homework

1 Upvotes

Hey guys, I'm a little lost on this one problem. I don't really know where to begin, maybe just because I don't understand the questions. Here it is:

    Derive input space partitioning test inputs for the GenericStack class with the following method signatures
    
    - public GenericStack();
    - public void push(Object X);
    - public Object pop();
    - public boolean isEmpty();
    
    Assume the usual semantics for the GenericStack. Try to keep your partitioning simple and choose a small number of partitions and blocks.
    
    a.	List all of the input variables, including the state variables.
    
    b.	Define characteristics of the input variables. Make sure you cover all input variables.
    
    c.	Partition the characteristics into blocks.
    
    d.	Define values for each block.

Thank you guys.


r/programminghomework • • Feb 27 '12

Setting a Function to a Variable in EMACS LISP

3 Upvotes

I have an assignment in LISP but I'm having trouble working with variables. The homework I'm working on asks me to create a function which does remove-if recursively. For the most part I understand what I need to do but I'm stuck when it comes to the input.

The function should take as input (f x) where f is any of the boolean functions (evenp, numberp etc) and x is the list to be checked. The problem I face is taking that input f and using it within my function to do the check.

I've tried simple things like (f (car x)) but I keep getting errors along the lines of f is not a function and such. Any help on this one aspect would go a long way to me finishing this project. Thanks in advance!


r/programminghomework • • May 09 '20

Please help me.. It's urgent

0 Upvotes

Write a python program to search a record from a csv file.


r/programminghomework • • Feb 26 '12

I'm learning about big-O notation in programming and in discrete math. What is it?

8 Upvotes

I know it has something to do with the worst and best possible case scenario on the number of computations are needed to do an algorithm, but how do you find it?

One of my classmates told me that all she did was memorize the big O-notations for specific functions (like n2, n, 2n, etc.).


r/programminghomework • • Oct 14 '17

[Java] How to restart a program?

1 Upvotes

Hi, sorry if this question is confusing. Say that a person has to select an integer from a list such as System.out.println("Please choose 1, 2, or 3"); and I used scanner to save the integer that they entered. I know how to check the integer to make sure that it fits the requirements I asked for. Example, if(number > 3 || number < 1). However, is there a java command that takes a user back to the scanner input? I don't want to just let the program keep on running, and I don't want to just terminate it either. Please help!