Write a program in C++ that lets the user enter the total rainfall for each of 12 months into an array of double. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Input Validation: Do not accept negative numbers for monthly rainfall figures. At the end, the program should display a list of months, sorted in order of rainfall, from highest to lowest.
Q: Write C++ application with several functions that deal with a two-dimensional array of positive…
A: The problem shows a need of printing a 20*20 matrix having random numbers from 1 to 1000. It then…
Q: please write c++ program to solve this problem for a beginner student. you only use array and…
A: Given data is shown below:
Q: Write a program in C++ that lets the user enter a product code. The program should determine if the…
A: I have provided C++ CODE along with CODE SCREENSHOT and TWO OUTPUT…
Q: in C++ : You are given an array of integers representing asteroids in a row. For each asteroid…
A: Coded in C++, I used stacks in solving this problem.
Q: Write a program in c that inputs an array of n size from keyboard. Your program should implement the…
A: Array: It is a data structure that allows you to store several data items of the same kind. An…
Q: Write a function that takes a string and calculates the number of letters and digits within it.…
A: Algorithm - Take one string as input. Now use the below logic…
Q: in C++ Carry out the following tasks with an array: Allocate an array of ten integers. Put the…
A: Required: in C++ Carry out the following tasks with an array: Allocate an array of ten integers.…
Q: Given an integer array of positive single digit values such as: int a[) = {8,4,2,6,9}; 1) Write a…
A: The objective of the given problem is to create a recursive function that concatenates all array…
Q: (Initialize array) Write a function called initializeArray that receives an array, its size, and two…
A: PROGRAM EXPLANATION Q1: - The random number is being generated using header files using cstdlib and…
Q: Write a C# application that populates an array with 10 items and prints all N multiples. Where N is…
A: The following rubrics will be followed by the C# program: Declaring and initializing a 10-element…
Q: 1. Write a complete C program that declares an array of size 10 of datatype double, inputs 10 values…
A: C code and output are in step2.
Q: You have to write a C++ Program to store temperature of four different cities for a week. It shall…
A: The program prompts the user to enter temperature for 4 cities for a week and is stored in an array…
Q: Code an exam in Java that repeatedly asks the user to enter the capital for a province in Canada.…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
Q: Write a complete C program that analyse the statistics of 5 YouTubers' debut video. The program…
A: for(int i=0;i<5;i++) { printf("Enter number of views on debut video of youtuber %d…
Q: Write a C programming to find out maximum and minimum of some values using function which will…
A: There Are two questions I have solved first one means 2.
Q: anguage:Java Write a function called rightTrimp that trims the digits of the positive integer sent…
A: import java.util.*;public class Main{ public static int rightTrimp(int n,int t) //rightTrimp…
Q: Write a program in C that will find the second smallest number from an array and print those numbers…
A: While doing programming in any programming language, you need to use various variables to store…
Q: Please fast : Write a C program that reads 5 numbers from the user and store them in an array. Then…
A: The question is: writing C program in respect to the given condition.
Q: Write a program in C language that accepts integers as command-line arguments. The number of…
A:
Q: Write a program that reads a string and mirrors it around the middle character. Examples: aabb…
A: #include <stdio.h>#include<stdlib.h>void mirror(char* str){ //takes a string and…
Q: Write a program designed to get ages and heights from the user, then find the average age, average…
A: Below is the C program and its approach to get the ages and heights from the user and then find the…
Q: Write a recursive function named “oddRec” that takes the address of the array and the number of…
A: #include<iostream>using namespace std;int oddRec(int arr[], int n){ int i; if(n>0)…
Q: 1. Write a complete C program that declares an array of size 10 of datatype double, inputs 10 values…
A: here is your code
Q: Write a program in C++ that allows the user to enter the last names of five candidates in a local…
A: In this program, you need to take user input for candidate names and number of votes received by…
Q: Write a program that does the following: Creates int array array_1 of length 10. Creates int array…
A: Note: as per Bartleby's strict policy & guidelines, I am only allowed to answer the first…
Q: Write a C++ console application that allows your user to enter the total rainfall for each of 12…
A: To write a C++ program that asks the user to enter total rainfall for 12 months into an array of…
Q: Your Friendly Array Neighbor Program only in java not in python Create a Java program that…
A: While loop can be used to create new arrays till the n-th day. For loop is used to check and modify…
Q: Write a function in C language that takes your student number as a value and adds each digit of your…
A: Declare a variable n of long type then read a value from the user. Then call the function. In the…
Q: Q3. Write a c++ program that inputs 10 numbers from user in an array, then check even, odd and prime…
A: The ask is to write a c++ program that inputs 10 numbers from user in an array, then check even, odd…
Q: An array with an odd number of elements is said to be centered if all elements (except the middle…
A: import java.util.Scanner; public class centered { public static int isCentered(int[] ar)…
Q: Write a program with a function which accepts an array of integers and a key value.The function…
A: Start Input number of elements in array Input all values in array Input key For each element in…
Q: Q5. Write a program in C++ using object oriented concepts to input a list of numbers in an array and…
A: Sample Response: //C++ program to arrange the odd at the beginning of array and even number at the…
Q: C Programming: Write a program that reads a list of words. Then, the program outputs those words…
A: #include <stdio.h>#include <string.h> void main(){int cnt = 0, c = 0, i, j = 0, k, space…
Q: In c++, Declare a constant “ SIZE = 5 ” Declare an array of ints , of size SIZE . Initialize that…
A: Code: #include <bits/stdc++.h>using namespace std;int main(){ //declaring constant size…
Q: Code in C++ Language As a cashier, you would always hate those times when customers choose to take…
A: The code in C++ is as follows #include <iostream> using namespace std; int main() { cout…
Q: write a program that reads in an array of type int. You may assume that there are fewer than 20…
A: #include <iostream>#include <vector>using namespace std; void countFreq(int arr[], int…
Q: Write a program in C++ that simulates a lottery. The program should have an array of five integers…
A: Program: //include the header files #include <iostream> #include <time.h> #include…
Q: Write a recursive arrayToN function which returns the concatenation of all array values as an…
A: #include <stdio.h>#define MAX_SIZE 100 /* Function declaration */void arrayToN(int arr[], int…
Q: b. In the main method, The program reads from the user the number of branches in the company. The…
A: Step 1 : Start Step 2 : Create a method getBranchSalariesSum to compute the Maximum salary given by…
Q: Q6: Write a complete program in C++ that declares a one-dimensional array of integers. First, you…
A: We have to write a C++ program that takes a one-dimensional array of integers. Then, print this…
Q: Write a function that takes a string and calculates the number of letters and digits within it.…
A: Algorithm - Take one string as input. Now use the below logic…
Q: In C++ >>> Write a program that prompts the user to enter 50 integers and stores them in an array.…
A: A C++ program is as follows, File name: “main.cpp” #include <iostream> using namespace std;…
Q: (Initialize array) Write a function called initializeArray that receives an array, its size, and two…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: Write a function that takes a string and calculates the number of letters and digits within it.…
A: In this problem we need to design the pHP program. Input - String Ouput - Array
Q: In C++ language, write a program to print "Junior" if the given array element starts with 'J' and…
A: In C++ language, write a program to print "Junior" if the given array element starts with 'J' and…
Q: Writ a program in C that inputs array of n size from keyboard. Your program should implement the…
A: Objective: A program is developed to perform insertion and manipulation of array content. The array…
Q: Create a simple program in c++ that serve to introduce arrays. In this program, creates an array of…
A: //include the required haeder file #include <iostream> using namespace std; //definition of…
Q: write a program in c++ using array If the user enters 'A', ask the user for the following…
A: Algorithm: Note: Assuming user enters correct input Step1: start Step2: declare all the necessary…
Q: Create a program in C Language that calculates a student's overall grade based on their assignments,…
A: #include <stdio.h>#include <stdlib.h> #define SIZE1 5#define SIZE2 3#define SIZE3 2 int…
Write a program in C++ that lets the user enter the total rainfall for each of 12 months into an array of double. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts.
Input Validation: Do not accept negative numbers for monthly rainfall figures.
At the end, the program should display a list of months, sorted in order of rainfall, from highest to lowest.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- Write a program in C as follows:- Create an array of integers named “toy” that has 120 rows and 4 columns.- The program should repeatedly display the following menu:A or a to add a toy to the bagV or v to calculate and display the total value of the toysW or w to calculate and display the total weight of the toysD or d to delete a toy from the arrayM or m to calculate and display the number of small toysN or n to calculate and display the number of medium toysL or l to calculate and display the number of large toysX or x to start filling a new bagP or p to exit programThe following functions need to be created and used in the program:- Void wipe(int cat[][4], int n);- Void populate(int cat[][4], int n);- Int size(int L, int W, int H);- Int check_capacity(int cat[][4], int n, int tsize, int tweight);- Int rm_toy(int cat[][4], int n, int toynum);- Int weight(int cat[][4], int n);- Int value(int cat[][4], int n);- Int small(int cat[][4], int n);- Int medium(int cat[][4], int n);- Int…Write a program in C as follows:- Create an array of integers named “toy” that has 120 rows and 4 columns.- The program should repeatedly display the following menu:A or a to add a toy to the bagV or v to calculate and display the total value of the toysW or w to calculate and display the total weight of the toysD or d to delete a toy from the arrayM or m to calculate and display the number of small toysN or n to calculate and display the number of medium toysL or l to calculate and display the number of large toysX or x to start filling a new bagP or p to exit program - Santa’s bag can hold 30 large toys or 60 medium toys or 120 small toys or any combination ofsizes that satisfy this requirement (ex: 29 large + 1 medium + 2 small would be max capacity).Also, the total weight of toys cannot exceed 620 Kgs. All values are entered in centimeters andgrams. (Hint: the return values of the size function should help you in calculating the bagcapacity.)The…In java: Develop a function that accepts an array of integers and returns their average. Develop a function that accepts an array of integers and a threshold value from the user. The function returns how many values in the array are strictly greater than the cutoff. Using the functions written for #1, #3, and #4, find the number of values above average in two randomly generated arrays. Develop two functions:a. a function that returns the index of the maximum value in an array of integers passed by a caller, the caller prints the returned index and the value at that indexb. a function that returns the index of the alphabetically first value in an array of strings, the caller prints the returned index and the value at that inde Develop two functions:a. a function that swaps the alphabetically first value in an array of Strings with the first value in the array. Call this function twice on two different arrays of Strings; in the caller, use the function written for #2b to display…
- Write a program in c++ language that simulates a magic square using 3 one- dimensional parallel arrays of integer type. Each one of the arrays corresponds to a row of the magic square. The program ask the user to enter the values of the magic square row by row and informs the user if the grid a magic square or not. The Lo Shu Magic Square is a grid with 3 rows and 3 columns. It has the following properties: - the grid contains the numbers 1-9 exactly - the sum of each row, each column and each diagonal all add up to the same number. Input for this project - values of the grid(row by row) Output for this project - whether or not the grid is magic square Global constants - const int ROWS = 3; - const int COLS = 3; -const int MIN = 1; -const int MAX = 9; Use following functions: - void fillArray(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size): accepts 3 int arrays and as a size as arguments and fill the arrays out with values entered by the user. - void showArray(int…Help writing a program in c++ that asks a user for a number (variable num) and then takes that number input to print out the nth term of a sequence? The sequence begins with 1 and then every number after is a prime factor of 3, 4, or 6. This needs to be done without using vectors or arrays. . . . For example: Sequence is : 1, 3, 4, 6, 8, 9, 12, 16, 18, 20, ... (cont.) User input (num) is : 6 Output : 12 (6th term) . . Please add comments explaining the code for better understanding if possible, thank you!!Write a program in C that will find the second smallest number from an array and print those numbers in the main function. The size of the array will be 10. take the input from user. use the following function prototype: void findMinArr(int size, int arr[], int *secondMin)
- In C++ Please Write a program that accepts two integer values, called "arraySize" and "multiplier", as user input. Create an array of integers with arraySize elements. Set each array element to the value i*multiplier, where i is the element's index. Next create two functions, called PrintForward() and PrintBackward(), that each accept two parameters: (a) the array to print, (b) the size of the array. The PrintForward() function should print each integer in the array, beginning with index 0. The PrintBackward() function should print the array in reverse order, beginning with the last element in the array and concluding with the element at index 0. (Hint: for help passing an array as a function parameter, see zybooks section 6.23) As output, print the array once forward and once backward. Sample Input 3 2 Sample Output 0 2 4 4 2 0Write complete C++ program to simulate a Magic 8-Ball, which is a fortune telling toy that displays a random response to a yes or no question. The program should prompt the user to ask a question and then display one of the responses randomly selected from the following array. string magic8arr[] = { "Yes, of course!", "Without a doubt, yes.", "You can count on it.", "For sure!", "Ask me later.", "I'm not sure.", "I can't tell you right now.", "I'll tell you afterwards.", "No way!", "I don't think so.", "Without a doubt, no.", "The answer is clearly, NO." }; Sample out is: Enter a yes or no question: Will it rain today? Ask me later.For this project the program should be made in C++ Write a menu driven program that reads an array of 10 integer from standard keyboard (user) utilizing a loop and outputs the following depending on user's choice Choice 1 - Prints the elements of array Choice 2 - Prints the minimum value of the array Choice 3 - Prints the maximum value of the array Choice 4 - Prints the product of all the numbers utilizing a loop. Choice 5 - Prints the sum of all the numbers utilizing a loop Choice 6- Print the elements of array in a reverse order When the program is done, your program should ask the user if they would like to enter another set of 10 numbers and the program should repeat itself. Input validation: Your program should only accepts integers.
- Write a program in C++ that repeatedly prompts the user to enter a capital for a state. Upon receiving the user input, the program reports whether the answer is correct. A sample run is shown below: What is the capital of Alabama? Montgomery [ENTER]Your answer is correct.What is the capital of Alaska? Anchorage [ENTER]The capital of Alaska is Juneau Assume that fifty states and their capitals are stored in a two-dimensional array, see below. The program prompts the user to enter ten states’ capitals and displays the total correct count.Give solution in C ++ Language with secreenshoot of source code. Part 01In this task, you need to do the following:• Write a function named displayMessage() that takes user name as input in character array and then shows greetings• Now take the name input in main() and pass the name as an argument to displayMessage() function• Change the displayMessage() method such that it returns the number of characters after displaying the greetings part 02Write a function power that takes two parameters a and b. And it returns the power as ab.In C++ language For number 2 through 4 create an integer array with 100 randomly generated values between 0 and 99; pass this array into all subsequent functions. Place code in your main to call all the methods and demonstrate they work correctly. Using just the at, length, and substr string methods and the + (concatenate) operator, write a function that accepts a string s, a start position p, and a length l, and returns a subset of s with the characters starting at position p for a length of l removed. Don’t forget that strings start at position 0. Thus (“abcdefghijk”, 2, 4) returns “abghijk” Create a function that accepts the integer array described above returns the standard deviation of the values in a. The standard deviation is a statistical measure of the average distance each value in an array is from the mean. To calculate the standard deviation, you first call a second mean function that you need to write (do not use a built in gadget. Then sum the square of the difference…