Write a program that receives a character array from the user and calculates Total characters, uppercases, lowercases, and spaces then returns them all. (In this question, all characters except spaces are counted as letters).
Q: write a program to create a one dimensional array. get the number of element from the user and the…
A: Java program: //importing java swing class import javax.swing.*; //Main class public class Main…
Q: Using methods and arrays, write a program that Creates and fills an array A of size 100 filled…
A: Note: Below is the required program in the Java language. Program Approach: Importing necessary…
Q: Write a program that will take input from the user for 100 items and store the items in an array.…
A: I have given this answer in step-2.
Q: Write a program to read in a collection of 5 exam scores ranging from 1 to 100. Your program should…
A: Here I have created an array to store 5 values into it. Next, I have used a for loop to iterate over…
Q: Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and also provided OUTPUT…
Q: In java, please read the text file as array. Then, replace the null with 0 and calculate the sum of…
A: Q: In java, please read the text file as array. Then, replace the null with 0 and calculate the sum…
Q: Write a program, which creates an array of N elements of type integers. Output and display how many…
A: We need to write a program in C programing language to find the elements from an array of integers…
Q: Write an application that stores nine integers in an array. Display the integers from first to last,…
A: HI THEREI AM ADDING C CODE AS PER REQUIREMENT BELOWPLEASE GO THROUGH IT THANK YOU
Q: Write a program that takes 20 elements of array from user at run time. Find maximum element of array…
A: Array: It is a data structure that allows you to store several data items of the same kind. An…
Q: Write a program that prompts the user to enter an integer value in an array, and user can also print…
A: I give the code in Java along with output and code screenshot
Q: Consider the int Array below and determine the values of A and B so that Array[0] has an integer in…
A: We have no inbuilt function to produce the number in range usig the rand function . Hence we have to…
Q: Write a program that accepts a series of numbers, stores the numbers into an array, writes the…
A: - We will have one array which will take the numbers we want and then accordingly the operations…
Q: Write a program, which creates an array of N elements of type integers. Output and display how many…
A: Solution :
Q: Write a JavaScript program to find out the most frequent element in that array Now change your array…
A: Algorithm: Initialize an Array Declaration and initailization variablesw such as occurence = 1;…
Q: Write a program that declares two arrays of integers. Fill the first one from the user and the…
A: As per guidelines, we are supposed to answer only one question. Kindly repost other question as a…
Q: Using methods and arrays, write a program that • Creates and fills an array A of size 50 filled with…
A: The program is implemented in java with structured approach. To run this program in Dr. java please…
Q: Using methods and arrays, write a program that • Creates and fills an array A of size 50 filled with…
A: An object which stores similar-data typed elements with a specified space is known as an Array.…
Q: Write a program that uses a 2-D array to store the highest and lowest temperatures for each month of…
A: The answer is given below:-
Q: Write a program to shift all the zero present in the array in the alternative order, For example.…
A: Include Header files Declare an array A[] initialized with values using for loop reorder the given…
Q: Write a program that creates a 2D array of size 4x5. Then, user enters the elements for this 2D…
A: // C++ Program to print the elements of a// Two-Dimensional array
Q: Write a program that declares two arrays A and B of size 10. Fill array A by generating random…
A: Here we will write a program
Q: Write a program to convert two dimensional array into one dimensional array and reverse.
A: The required Java code is given below: import java.util.*;public class Main { public static void…
Q: B. Draw the 2D array that exists after the following code executes. int[][] x = new int[4][5];…
A: Lets see the solution.
Q: Write a program that defines symbolic constants for all seven days of the week. Create an…
A: Take 7 constants for the day's number or the day's name and assign the values. Take an array of same…
Q: Write a program that creates an array of 10 user to input 10 numbers and stores each e
A: #include<stdio.h>#include<conio.h>void main(){ int a[10], i; clrscr();…
Q: Using methods and arrays, write a program that Creates and fills an array A of size 50 filled with…
A: Please refer below code and output: language used is Python: import randomrandomlist = [] for i in…
Q: Write a program that counts the number of letters in each word of the Gettysburg Address and stores…
A: the answer is an given below :
Q: Write a program that first reads an integer for the array size, then reads numbers into the array,…
A: #include<stdio.h> int main() { int a[N],i, even=0, odd=0; printf( "Enter %d integer…
Q: An array is given as int x[6] = {19, 10, 8, 17, 9, 15};, what is x[4]
A: Here is the value of the given index in the array:
Q: Given an array that contains names of some colors, write a program that picks a color randomly from…
A: Given: An array that contains names of some colors, string colors[] = {“Green”, “Blue”, “Red”,…
Q: Write a program that takes 20 elements of array from user at run time. And also Find maximum element…
A: Program Approach: Create an array of size 20 Take inputs from users Use for loop to print array…
Q: Write a program which takes 2 arrays of 10 integers each a and b. c is an array with 20 integers.…
A:
Q: Consider the int Array below and determine the values of A and B so that Array[0] has an integer in…
A: The question is to find the values of A and B.
Q: According to the following program segment answer the following questions. ArrayList animals = new…
A: the above program is to add a unique element in the array.
Q: Write an application program that could be used to find the numbers divisible by 30 stored in a…
A: Computer Programming: Programming is the procedure of forming a set of instructions that directs a…
Q: Write a program in JavaScript to find intersection of two arrays and you have to print that
A: Requirements:- Write a program in JavaScript to find the intersection of two arrays and you have to…
Q: Write a program called Words that: prints your name followed by three asterisks; reads the words in…
A: Note: Answering the first three subparts as per the guidelines. Input : Name Output : Show name…
Q: Task: ● . Write a program that takes in temperatures for 10 days and stores it in an array. Find the…
A: An array is an object which contains the elements of the similar data type. The elements stored in…
Q: Write a program that declares an array of 10 numbers, and then read 10 single digit numbers nto the…
A: program that declares an array of 10 numbers, and then read 10 single digit numbers into the array…
Q: Write a program that will read your full name and store it in an array. Write the name back to the…
A: 1) Declare character array with name (size 50) 2)Read the string name with help of cin.getline()…
Q: Write a program that reads 10 integers stored in an array and an integer, counts the occurrence of…
A: Let us see the answer - Introduction- Array- Instead of defining distinct variables for each item,…
Q: Write a program that first reads an integer for the array size, then reads characters into the…
A: #include<iostream>using namespace std;void Consonant(char x[], int s){ for(int…
Q: Write a program, which creates an array of N elements of type integers. Output and display how many…
A: Start initialize count to zero Input number of items to be entered Input numbers in an array Check…
Q: Write a program that declares an array of 15 integers and reads the values from the user. Make sure…
A: Given: Write a program that declares an array of 15 integers and reads the values from the user.…
Q: Write a program that takes input 10 integer numbers and stores in an array. Afterward, count the…
A: Start. Check the array indexes if they have same number. If yes then increase the index and check…
Q: Write a method combine(int a[], int b[]) which takes two sorted integer arrays, a[ ] and b[ ], and…
A: Step 1 : Start Step 2 : Define a method combine() which accepts two array a and b. Step 3 :…
Q: Write a function that takes an array of ints, and the size of the array – another int. It also…
A: Here, we are going to find the average of an integer array. As programming language is not mentioned…
Write a C++
Step by step
Solved in 2 steps
- Write a program that receives a character array from the user and calculates Total characters, uppercases, lowercases, and spaces then returns them all. (In this question, all characters except spaces are counted as letters). Sample Run: Character Array: Hello, I am a stu dent of FAST University. Values returned: No. of letters are: 34 No. of spaces are: 7 No. of uppercase letters are: 7 No. of lowercase letters: 25Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display (in this order): the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Months should be expressed as English names for months in the Gregorian calendar, i.e.: January, February, March, April, May, June, July, August, September, October, November, December. Do not accept negative numbers for monthly rainfall figures. When a negative value is entered, the program outputs "invalid data (negative rainfall) -- retry" and attempts to reread the value. NOTE: Decimal values should be displayed using default precision, i.e. do not specify precision.Write a program that uses a 2-D array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods with their appropriate parameters: a.) getData: This method reads and stores the data in the 2-D array. b.) averageHigh: This method calculates and returns the average high temperature of the year. c.) averageLow: This method calculates and returns the average low temperature of the year. d.) indexHighTemp: This method returns the index of the highest temperature in the array. e.) indexLowTemp: This method returns the index of the lowest temperature in the array. Use the following input: High temp for each month: 30 40 45 60 70 90 89 95 79 90 70 40 Low temp for each month: 10 -10 20 30 50 75 85 79 50 80 30 20
- 2. A store owner wants the total sales for 2020. Write a program that will load an array with 12 months of sales. Use iomanip to make a nice-looking chart that shows the monthly sales, the month with the highest sales, lowest sales, and average for the year sales. January ……………. $50,000 February…………… $60,000 March ……………….$80,000 April ………………..$106,000 May …………………..$50,000 June ………………..$190,000 July ………………….$900,000 August …………… $102,000 September ………..$70,000 October …………..$700,000 November………… $90,000 December …………$90,000 Total Sales for the year 2020 was ………………….………$ The month with highest sales was ****** at ………..$ The month with lowest sales was ****** at ………...$ The average of sales for the year was ……………………$ C++Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods: Method getData: This method reads and stores the data in the two-dimensional array. Method averageHigh: This method calculates and returns the average high temperature of the year. Method averageLow: This method calculates and returns the average low temperature of the year. Method indexHighTemp: This method returns the index of the highest temperature in the array. Method indexLowTemp: This method returns the index of the lowest temperature in the array.The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square 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. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns…
- The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square 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. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Processing Requirements - c++ Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number //…RetailItem Class Write a class named Retailltem that holds data about an item in a retail store. The class should have the following fields: • description. The description field references a String object that holds a brief description of the item. • unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. • price. The price field is a double that holds the item's retail price. Write a constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three RetailItem objects and stores the following data in them: Description Units on Hand Price Item #1 Jacket 12 59.95 Irem #2 Designer Jeans 34.95 [rem #3 Shirt 24.95Write a program that does the following: • Reads an integer from the user that represents the number of the students in a class. • Reads the scores of the students from the user and stores them in an array. • Calculates and prints the average of the students with a passing grade (above or equal to 60). Hints: Assume that the scores of the students are integers between 0 and 100 (inclusive) • Assume that there is at least one student in the class with a passing grade. Using java Sample run 1: Enter the number of students in the class: 3 Enter the scores of 3 students: 90 80 40 The average of the students with a passing grade is 85.0 Sample run 2: Enter the number of students in the class: 5 Enter the scores of 5 students: 90 80 40 60 70 The average of the students with a passing grade is 75.0
- Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: Part a: Function getData: This function reads and stores data in the two- dimensional array. Part b: Function averageHigh: This function calculates and returns the aver- age high temperature for the year. Part c: Function averageLow: This function calculates and returns the average low temperature for the year. Part d: Function indexHighTemp: This function returns the index of the highest high temperature in the array. Part e: Function indexLowTemp: This function returns the index of the lowest low temperature in the array. (These functions must all have the appropriate parameters.) #include <iostream> using namespace std; const int NO_OF_MONTHS = 12; void getData(int twoDim[][2], int…Write a function called initializeArray that receives an array, its size, and two integers andinitializes the array with random values between the first integer and the second integer. Write anotherfunction called printArray that receives an array and its size and prints the array elements in a column. Writea test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive,and then prints the array using the above functionsWrite a program named as reverse.c that reads a message, then prints the reversal of the message. The output of the program should look like this: Enter a message: Don ’t get mad, get even. Reversal is : .neve teg ,dam teg t ’noD Hint: Read the message one character at a time (using getchar) and store the characters in an array. Stop Reading when the array is full or the character read is ‘\n’. The framework of reverse.c is as below: /* reverse.c */ #include #define N 50 int main(){ int arr[N],i=0; char ch; printf("Enter a message: "); /* Put code here to get input from user by using getchar() */ printf("Reversal is: "); /* Put code here to print out the reversal by using putchar()*/ printf("\n"); return 0; }