Assignmentgeek Q&A - Recent questions and answers in Programming
https://assignmentgeek.com/qa/qa/programming
Powered by Question2AnswerAnswered: summer homework programming
https://assignmentgeek.com/qa/88/summer-homework-programming?show=90#a90
#include <stdlib.h> /* rand() */<br />
#include <time.h> /* time() */<br />
#include <stdio.h> /* printf() */<br />
<br />
#define N_OF_FRIENDS 3<br />
#define MAX_MOTHER_CARE 10<br />
#define MIN_MOTHER_CARE 1<br />
<br />
int main() {<br />
const unsigned SIZE = N_OF_FRIENDS;<br />
int ArrayA[N_OF_FRIENDS] = { 0 }; /* initialize all the elements */<br />
unsigned index = 0;<br />
int Total = 0;<br />
int Sum3 = 0;<br />
<br />
srand((unsigned) time(0)); /* set new seed for a generator each time */<br />
for (index = 0; index < SIZE; index++) {<br />
ArrayA[index] /* generating numbers in a range */<br />
= rand() % (MAX_MOTHER_CARE - MIN_MOTHER_CARE + 1) + MIN_MOTHER_CARE;<br />
printf("%d ", ArrayA[index]);<br />
}<br />
printf("\n");<br />
<br />
/* We just need to check that total number of chocolates (Total) equals<br />
* A[1] + (A[1] + 3) + (A[1] + 3 + 3) + ... + (A[1] + 3 * (n - 1)), equals<br />
* n * A[1] + 0 + 3 + 6 + ... + 3 * (n - 1), where A[1] is a natural number.<br />
* Or, in other words, the difference between total number of chocolates<br />
* and (0 + 3 + 6 + ... + 3 * (n - 1)) is divisible by n and positive.<br />
* Or, in other words, Total - (0 + 3 + 6 + ... + 3 * (n - 1)) % n = 0 and<br />
* that difference is positive.<br />
*/<br />
for (index = 0; index < SIZE; index++) {<br />
Total += ArrayA[index]; /* add and assign */<br />
Sum3 += index * 3; /* add and assign */<br />
}<br />
if ((Total - Sum3) % 3 == 0 && (Total - Sum3) > 0) {<br />
printf("Yes, it is possible, %d, %d, A1=%d\n",<br />
Total, Sum3, (Total - Sum3) / 3);<br />
} else {<br />
printf("No, it is impossible, %d, %d\n",<br />
Total, Sum3);<br />
}<br />
<br />
return 0;<br />
}Programminghttps://assignmentgeek.com/qa/88/summer-homework-programming?show=90#a90Thu, 27 Jul 2017 12:01:06 +0000hell tasks ----- help needed
https://assignmentgeek.com/qa/89/hell-tasks-help-needed
If there is a space to park the vehicles then some n number of vehicles are parked there and then count how many are of cars, and how many of are scooters and note the arrival time and the departure time, display the order of parked vehicles, and the colour of vehicle , if he wants to take the vehicle from the parking he has to tell the number of vehicle if the number is wrong he can't able to take the vehicle from parking in that case he has to tell the car model and the colour of vehicle and also the RC book of vehicle and also he has to calculate the parking fees based on time he kept.Programminghttps://assignmentgeek.com/qa/89/hell-tasks-help-neededThu, 27 Jul 2017 11:46:44 +0000Answered: HTML coding, coloring text
https://assignmentgeek.com/qa/23/html-coding-coloring-text?show=25#a25
<p style="background-color:grey;color:green;">your text your text </p><br />
also you can check this site, cool one for this things <a href="https://www.w3schools.com/" rel="nofollow">https://www.w3schools.com/</a>Programminghttps://assignmentgeek.com/qa/23/html-coding-coloring-text?show=25#a25Fri, 14 Jul 2017 07:56:44 +0000Answered: Java script help
https://assignmentgeek.com/qa/13/java-script-help?show=16#a16
import java.util.Scanner;<br />
<br />
public class Test {<br />
public static void main(String args[]) {<br />
Scanner s = new Scanner(System.in);<br />
System.out.println("Enter the radius of a circle: ");<br />
double radius;<br />
do {<br />
double temp = s.nextDouble();<br />
radius = (temp < 0) ? -1 : temp;<br />
if (radius == -1)<br />
System.out.println("Enter the positive value");<br />
} while (radius == -1);<br />
}<br />
}Programminghttps://assignmentgeek.com/qa/13/java-script-help?show=16#a16Wed, 12 Jul 2017 11:45:31 +0000