In the middle of a c++ test

in the middle of a c++ test
can Sup Forums solve these for me?
i'm failing uni btw

another one

Had it been anything else other than math, I could have helped you ace the test. Numbers never resonated with my mind.

thanks anyways user
nice dubs btw

you got balls of steel son

running out of time lads

well looks like i'm dropping out

Drop out and be a bohemian. College will bring you "success" (i.e. living in the suburbs where you're supposed to reproduce, own a boat and have a boring life).

If you can not to this beyond basic shit, you should just give up on life in general

Trust me, you don't want to be a code monkey unless you love doing it. Plenty of Ching Chongs and Garnishs willing to do it for cheap.

First question is literally 5 minutes worth of thinking and work. You take modulo 100 for any integer larger than 100 to get the last 2 digits. For any integer smaller than 100 you just perform a simple check to see whether it is 45 or not. If you allow negative numbers as well, take the absolute value of the input when making the operations.

Fucking beyond simple. Do it with for a for-loop or while-loop.

Uhh.... "The function should return the percentage of numbers that starts with 45"

Example: The numbers 645, 945, 10045 start with 45"

You're failing uni because you have retarded professors. None of those START with 45.

lmao,true that

Is this the sameness test from last year?
S2_2015-Google Docs

double func(int array[size]
{
for (int i=0; i

Is doing that difficult?

Yeah was confused as fuck about that too lol

i'm the one who posted the function

the questions u have are pretty difficult, theoretically theyre very easy/already implemented but when you have to implement these on your own its pretty tough since you never do these things in a more advanced year or at work.
i'm a 3rd year student in software engineering, have a few courses to retake since i spent too much time playing vidya and browsing Sup Forums rather than studying (i also cheated on a few tests like you do now)

its very bad for you, i hope there's a second chance test and you'll study hard for it because you need to understand these things in order to progress

I think OP ran out of time. Fail!

Int function(String s1,String s2){
If(s1.size()>=s2.Size()){
Cout

it would be ridiculous if they use string::size()

You also gotta iterate through each letter if size is same
(bool notDone = s1[i]>s2[i]?1:0;)
According to the test the char magnitude matters

woops bad name for the bool :)

>asking Sup Forums for help
shouldve study pleb.

int GetNum45(array)
{
int total = 0;

for (int i = 0; i < array.size(); ++i)
{
if (array[i] == 45)
++total;
}

return (float)total / (float)array.size();
}

#define until(i, num) for (int i = 0; i < num; ++i) { }

static const int numNames = 20;
const char *names[numNames];

printf("enter %d names with at least 3 characters in each", numNames);

until(i, 20)
{
std::cin >> names[i];
}

until(i, 20)
{
if (names[i][0] == 'a' & names[i][1] == 'l' & names[i][2] == 'i')
names[i] = "ALI";
}

until(i, 20)
{
if (names[i][0] == 'm' && names[i].back() == 'a')
printf(names[i]);
}

#pragma once

enjoy your high grade bro.

Hello World

hello Devil

OP this is completely fucking trivial. If you can't even write these basic types of functions I wouldn't trust you anywhere near production code. WTF?

>programming in a piece of paper
You should be studying punched cards.