hi can you please use simple c++, and write with using "Arrays"
and include "ctype.h, string,iostream" and use "while"
"||&& operators" "for" "if" statements,
,this should be written in
c++101, thanks
NOTE: Please upvote if you find this solution useful in any way.
For any doubts or queries, use the comment section below.
CODE:
#include<stdio.h>
#include<ctype.h>
#include<iostream>
using namespace std;
//function to find minimum temperature
float min_temperature(float a[7]){
float num;
num = a[0];
int i=1;
while(i<7){
if(a[i] < num)
num =
a[i];
i += 1;
}
return num;
}
//function to find maximum temperature
float max_temperature(float a[7]){
float num;
num = a[0];
int i=1;
while(i<7){
if(a[i] > num)
num =
a[i];
i += 1;
}
return num;
}
//function to find average temperature
float avg_temperature(float a[7], float b[7]){
float avg;
int i=0;
while(i<7){
avg += a[i] + b[i];
i += 1;
}
return avg/14;
}
//function to find size of array
int size(float a[]){
return a.size();
}
//function to check whether array is empty or not
bool empty(float a[]){
return true;
}
//function to fill the array with elements
void fill(float a[]){
}
//function to swap array value with x
void swap(float a[], int x){
}
//main function
int main(){
float a1[7],a2[7];
cout << "Please enter this week
temperatur,\nMonday: ";
cin >> a1[0] >> a2[0];
cout << "Tuesday: ";
cin >> a1[1] >> a2[1];
cout << "Wednesday: ";
cin >> a1[2] >> a2[2];
cout << "Thursday: ";
cin >> a1[3] >> a2[3];
cout << "Friday: ";
cin >> a1[4] >> a2[4];
cout << "Saturday: ";
cin >> a1[5] >> a2[5];
cout << "Sunday: ";
cin >> a1[6] >> a2[6];
cout << "\nThis week,\n";
cout << "\tminimum temperature is: " <<
min_temperature(a2);
cout << "\n\tmaximum temperature is: " <<
max_temperature(a1);
cout << "\n\taverage temperature is: " <<
avg_temperature(a1,a2);
cout << "\n";
return 0;
}
Screenshots:


![Fri 16-37 itunction to f the srray with elenents /function to sap array value ith x in rloat ai17],2171: rout Please nter th](http://img.homeworklib.com/images/0a75f0d5-f66d-42b1-88b1-452cd587ed2b.png?x-oss-process=image/resize,w_560)
![2 Terminal Open nclude ctype.h us Lag nanespace std flast -in-terpersture( float Float n 817] lease enter this week texperatu](http://img.homeworklib.com/images/68210adf-6c46-4b5a-af5f-f8e07a990479.png?x-oss-process=image/resize,w_560)
If you want to add or remove any function, mention it in the comment section below.
hi can you please use simple c++, and write with using "Arrays" and include "ctype.h, string,iostream" a...
C++ Only. Don't use other libraries other than #include <iostream> and using namespace std; Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the week. Input file will contain temperature readings for each day of the week. Your function should read each line from the given filename, parse and process the data, and return the required information. Your function should return the highest temperature for the whole week. Empty...
HI USING C++ CAN YOU PLEASE PROGRAM THIS ASSIGNMENT AND ADD
COMMENTS:
stackARRAY:
#include<iostream>
#define SIZE 100
#define NO_ELEMENT -999999
using namespace std;
class Stack {
int arr[SIZE]; // array to store Stack elements
int top;
public:
Stack() {
top = -1;
}
void push(int); // push an element into Stack
int pop(); // pop the top element from Stack
int topElement(); // get the top element
void display(); // display Stack elements from top to bottom
};
void Stack...
use c++ and complete this lab #include <iostream> using namespace std; class FibObj { public: void setSize() { cout << "Enter an integer larger than 2: "; cin >> size; } int getSize() { return size; } void fibTerms(int x) // Write a recursive function { } explicit FibObj() // Default constructor was made explicit to avoid possible implicit type conversion { setSize(); int *arr; arr = new int[getSize()]; arr[0] = 1; arr[1] = 1; // Call recursive function here...
PART 1 Modify the class ArrayList given in Exercise 1 by using expandable arrays. That is, if the list is full when an item is being added to this list, the elements will be moved to a larger array. The new array should have twice the size of the original array. Using the new class ArrayList, write a program to store 1,000 random numbers, each in the interval [0, 500]. The initial size of the array in the class should...
Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator. Upon program execution, the screen will be cleared and the menu shown below will appear at the top of the screen and centered. The menu items are explained below. Help Smallest Quit H or h ( for Help ) option will invoke a function named help() which will display a help screen. The help screen(s) should guide the user...
USING THE C++ CODE BELOW, CAN YOU PLEASE SOLVE THE QUESTION AND
EXPLAIN THE STEPS.
class StaticStack
{
private:
int *stack;
int capacity;
int top; // index of the top
element
public:
StaticStack(int size); //
constructor
~StaticStack();
bool isFull();
bool isEmpty();
void push(int);
int pop();
};
#include "StaticStack.h"
#include <iostream>
using namespace std;
StaticStack::StaticStack(int size)
{
stack = new int[size]; //
constructing a size sized array
capacity = size;
top = -1; // empty stack
}
StaticStack::~StaticStack()
{
delete...
Please Write the following program in c# You are to write an application which will create a company, add agents (their name, ID, and weekly sales) to that company, and printout the details of all agents in the company. The application will contain three classes: Agent.cs, Company.cs, and CompanyTest.cs (this class is already provided). Flow of the application: The CompanyTest class creates an object of the Company class and reserves space for five agents. At this point if you call...
Use the C programming language to complete
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
// Declare Global variables here.
void array_stats() {
// Insert your solution here.
}
#include <stdlib.h>
#include <time.h>
int main() {
// Simulate the test setup process.
srand( time( NULL ) );
for ( int i = 0; i < 32; i++ ) {
val[i] = rand();
}
val_count = rand();
val_mean = rand();
val_min = rand();
val_max = rand();
// Call submitted code.
array_stats();
// Display...
Hi, it's C++ question. Only can use <iostream> and <fstream>libraries Please help me, thanks Question Description: For this project you will write a program to: a) read-in the 10 first names from a file (the file is a priori given to have exactly 10 entries, of a maximum length of 8 letters each) into a 2-dimensional character array, b) output the names to the terminal with each one preceded by a number indicating its original order in the list, c)...
10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...