C :: Program To Show Highest Negative And Lowest Positive Temperature Of Year
Jan 19, 2014
I have an assigment and I don't know yet how to write this program :" I introduce the average monthly temperatures of a year(12 values for 12 months). When I compile the program it needs to show the highest negative temparature and the lowest positive temperature of that year.
Example: Entry data: -4 -6 0 5 10 20 24 25 17 8 -1 -7 exit data : max negative= -1 and min positive= 5 "
View 11 Replies
ADVERTISEMENT
Apr 7, 2013
I cannot get this program from having a continuous loop. I need to have a user-defined loop.
Here is what I have so far:
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int a,b,c,high,med,low;
[Code] ....
View 7 Replies
View Related
Feb 2, 2015
My program uses a while loop to eventually get to an error of zero and a root of sqrt(3). I'm not understand why after the third iteration the program fails to compute a new x value. I'm using Visual Studio 2013. The code tag instructions were dubious.
Code:
#include <stdio.h>
#include <math.h>
main() {
/*This program uses the Newton-Raphson method to solve y = (x^3)-3 for it's roots.*/
printf("This program uses the Newton-Raphson method to solve y = (x^3)-3 for it's roots. Enter your estimate of the root.
");
float x,y,z;
int num;
num = 0;
[Code]...
View 1 Replies
View Related
Jan 23, 2013
I have been given an assignment which I have big troubles with. The assignment is:
"If I ask you “When is the weekday of the 2nd of August in 1429?”, you can answer immediately with your program to my question.
The initial value for the 1st of January in (the year) 1 will be sought by inducing, for example the crucifixion of Jesus is said to be held on Friday, the 3rd of April, AD 33."
How can I solve this?
View 3 Replies
View Related
Feb 12, 2013
I'm doing a project where I have to store information gathered (temperature and the time it was taken in seconds) in two separate vectors. After an unknown amount of data has been entered, and the end-of-file has been reached, I have to display the highest temperature and the time(s) it occured (bear in mind that the highest temperature may be recorded more than once). The output of that part should be as follows:
Highest temperature: 51
Recorded at time(s):
22:45
2:27
Something like that. The time should also be converted to hours and minutes. To the point: I've done some research on bubble sorting, but they only use it for arrays.
View 3 Replies
View Related
Sep 29, 2013
How can I properly find the lowest and the highest temperatures?
#include <iostream>
#include <string>
using namespace std;
[Code]....
View 1 Replies
View Related
Feb 26, 2013
I'm having trouble, I want the inner loop to display the lowest and highest score. If I assign initial values for the high and low score, it won't always work (because if no/ all scores are above/ below my initial values...)
But without assigning initial values for highscore and lowscore, One of them will always be undefined during the first runthrough.
#include <iostream>
using namespace std;
const int AGRADE = 90;
const int BGRADE = 80;
const int CGRADE = 70;
const int DGRADE = 60;
int main() {
[code]....
how do i set this up so it stores a low and high score, and then compares those to each next number in the series?
View 6 Replies
View Related
Mar 12, 2014
I am trying to calculate the largest and smallest values using functions. I keep getting this (pointer-to) error
#include <iostream>
#include <conio.h>
using namespace std;
void getValues(int [], int);
void displayValues(const int[], int);
int largest(const int[],int);
int smallest(const int[],int);
void displayLargestSmallest(int,int);
[code]....
View 3 Replies
View Related
May 2, 2013
What are positive and negative infinity for different data types in c++, are they represent maximum and minimum limit of a type? or positive infinity is not a finite value.can some explain this positive and negative infinity paradigm
View 3 Replies
View Related
Sep 28, 2014
How do i sort numbers from highest to lowest using qsort? I dont have a code. I dont know how to use this one.
View 1 Replies
View Related
Oct 1, 2013
I have everything down except for the highest # and lowest number being displayed.
The arrays are 23, 4, 76, 89, 12, 43, 37, 67, 21, 14.
I have the average which is 38.6 but i stuck getting highest number and lowest.
View 7 Replies
View Related
Oct 29, 2014
For my program i need to sort my int numbers [5] from highest to lowest but it seems that i made it go from lowest to highest ...
Code:
#include <iostream>
using namespace std;
int main() {
int numbers[5] = {3, -6, 10, 1, 130};
int counter1, counter2, tempNum;
//Highest to Lowest
[Code] ....
View 1 Replies
View Related
Oct 28, 2014
How do I sort names and grades in C from highest to lowest?
John 91
Joseph 92
Mary 93
Jake 94
Sorted Scores from highest to lowest
Jake 94
Mary 93
Joseph 92
John 91
View 2 Replies
View Related
Oct 9, 2014
Create a 1-D Array to hold a set of exam scores:
55 74 93 84 64 72 69 78 87 84 72 33 83 68 62 51 88 90
Write a program to do the following tasks:
1. Display scores in rows of four(4) scores.
2. Calculate average score and display.
3. Find Lowest score and display.
4. Find Highest score and display.
5. Find the deviation of each score, and display the score and its deviation.
6. Find the Standard Deviation and Display
7. How many scores are within One Standard Deviation
So I have the average down, but I am getting stuck at the part of displaying the highest and lowest score. Every time I run the program I get two giant negative numbers for both of them. I put all the scores into a .txt file and I just opened in through the program.
#include "TCHAR.h"
#include <iostream>
#include <fstream>
#include <iomanip>
[Code]....
View 1 Replies
View Related
Jul 24, 2014
I can display the highest and lowest score but I can't display the number of students who got the highest and lowest score.
int h=array[1];
int l=array[0];
int m=0,n=0;
for(int z=1; z<=20; z++) {
if(array[z]>h) {
h=array[z];
[code]....
this should be the output
12 students got the highest score of 45
8 students got the lowest score of 1
View 2 Replies
View Related
Oct 22, 2014
I was asked to create a C++ program that allows a user to take a test with series of different questions, and also retake the test if they choose to. I have been able to do that. But the other condition is to display the highest and lowest scores (highest and lowest correct answers) the user got, and in which test they got that score. For example, if the user takes the test 3 times, in which test did they get the highest score, and in which did they get the lowest score.
This is how far I went with the program. The code below only let the user take the test as much as they want, and tell them how many times they took it, and the last score they had. My idea is this, if I can make a variable store each test score, then I can compare them. But since there is no definite number of tests to be taken.
#include <iostream>
#include <string>
using namespace std;
void main() {
int correct = 0;
int wrong = 0;
[Code] .....
View 3 Replies
View Related
Nov 26, 2013
int Fib1 = 1;
int Fib2 = 2;
int Fib3 = 0;
int randomynumber;
int Loop;
[code].....
this returns negative numbers sometimes.what did i do wrong side note this is not the complete program it is only the part with the problem because the complete code is sort of longish and very confusing
View 2 Replies
View Related
Jan 27, 2014
#include <iostream>
using namespace std;
int initialization (int []);
int identifying (int [],int);
[Code].....
View 8 Replies
View Related
May 5, 2014
I have to print out which months have the lowest and highest amount of rainfall. I know how to find the lowest and highest value but how do I match them with there month?
#include <iostream>
using namespace std;
int main() {
const int rainfall = 12;
double months[rainfall];
int count;
[Code] .....
View 2 Replies
View Related
May 20, 2014
Write a C program that accepts 8 user input ratings on a new game. Print the lowest and highest ratings received. Use functions.
When i put in values to test the data it's not replacing highest or lowest it's just saying "The highest is 0.0" "The lowest is 0.0"
[#include <stdio.h>
double LowestAndHighest (double num);
void main(){
double num;
double RatingReceived =LowestAndHighest(num);
printf ("%lf", RatingReceived);
[Code] ....
View 1 Replies
View Related
Mar 25, 2013
I have this multi-dimensional array. There are 12 rows, each represents the months, and 2 columns, the 1st column represents the lowest temperature and the 2nd column represents the highest temperature.
I need to find the lowest temperature in only the first column and the highest in only the 2nd column.
This takes in the temperatures. LOHI = 2, MONTHS = 12, LOW = 0, HIGH = 1
void PopulateTemp(int temp[][LOHI])
{
for(int month = 0; month < MONTHS; month++)
{
cout << "Month " << month+1 << endl;
[Code]......
My professor said we only needed 1 for loop as you only need to read the data from one column in each?
View 10 Replies
View Related
Nov 21, 2014
I need to sort the Linked list from highest to lowest or in this case. The highest Bribe gets the higher priority on the list. I have looked all over the internet and have found some pretty decent examples but I still don't truly understand how to sort it. I think from looking at so many examples I have confused myself even more. I was reading about using Doubly Linked list but I don't even know if were allowed to use that.
1. The program runs perfectly at the moment. It prints out the list but does not sort it.
2. How to make sure that I am deleting the allocated memory correctly in the deconstructor.
Header File
#include <iostream>
#ifndef PERSON_H
#define PERSON_H
struct PersonRec;
class PersonList {
[Code] .....
View 6 Replies
View Related
Jun 8, 2014
I am doing a modification to a school project call rainfall statistics. I have that written, but need to sort the array and list rainfall totals from highest to lowest. I thought I knew what I was doing but I am having some difficulty locating all my errors, the error I keep getting now is:
1>------ Build started: Project: Rainfall Statistics Program, Configuration: Debug Win32 ------
1> Rainfall-main.cpp
1>Rainfall-main.cpp(88): error C2601: 'sortHighest2Lowest' : local function definitions are illegal
1> Rainfall-main.cpp(25): this line contains a '{' which has not yet been matched
1>Rainfall-main.cpp(96): error C2065: 'TOTAL_NUM_OF_MONTHS' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Below is my code, I know i'm missing something, just can't see it.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
//Here are the function prototypes
double getTotalRainfall(double[], int);
double getAverageRainfall(double[], int);
[Code] .....
View 2 Replies
View Related
Mar 8, 2014
// I believe my loop for the functions work but the values are not returning !
// Acoustic data
#include <iostream>
#include <fstream>
using namespace std;
double low( double []);
double high( double []);
void readArrayr( double [], double , double);
[Code] .....
View 6 Replies
View Related
Aug 10, 2014
We will make it in Turbo C, C++ and VB.. but as of now (Turbo C and C++)
This is the problem
Make a program based on the given logic below
a>b && a>c - a highest
b>a && b>c - b highest
c>a && c>b - c highest
and will determined the lowest
we will do this in different program control statements:
1.If-Then-Else
2.Multiple-If
3.Nested-If
4.Do Case
5.Do While
6.Do Until
7.For Next
8.Switch
9.Break
10.Loop
is it possible?
View 1 Replies
View Related
Jan 3, 2014
I have a list of numbers with decimal point saved in a text file (grade.txt) like this:
80.2
85.7
57.2
90.0
92.9
74.0
76.5
...
I would like to write a small program to display the top 10 highest and lowest grade points.
View 3 Replies
View Related