Answer:
// code in C++
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int sum_even=0,sum_odd=0,eve_count=0,odd_count=0;
int largest=INT_MIN;
int smallest=INT_MAX;
int n;
cout<<"Enter 10 Integers:";
// read 10 Integers
for(int a=0;a<10;a++)
{
cin>>n;
// find largest
if(n>largest)
largest=n;
// find smallest
if(n<smallest)
smallest=n;
// if input is even
if(n%2==0)
{
// sum of even
sum_even+=n;
// even count
eve_count++;
}
else
{
// sum of odd
sum_odd+=n;
// odd count
odd_count++;
}
}
// print sum of even
cout<<"Sum of all even numbers is: "<<sum_even<<endl;
// print sum of odd
cout<<"Sum of all odd numbers is: "<<sum_odd<<endl;
// print largest
cout<<"largest Integer is: "<<largest<<endl;
// print smallest
cout<<"smallest Integer is: "<<smallest<<endl;
// print even count
cout<<"count of even number is: "<<eve_count<<endl;
// print odd cout
cout<<"count of odd number is: "<<odd_count<<endl;
return 0;
}
Explanation:
Read an integer from user.If the input is greater that largest then update the largest.If the input is smaller than smallest then update the smallest.Then check if input is even then add it to sum_even and increment the eve_count.If the input is odd then add it to sum_odd and increment the odd_count.Repeat this for 10 inputs. Then print sum of all even inputs, sum of all odd inputs, largest among all, smallest among all, count of even inputs and count of odd inputs.
Output:
Enter 10 Integers:1 3 4 2 10 11 12 44 5 20
Sum of all even numbers is: 92
Sum of all odd numbers is: 20
largest Integer is: 44
smallest Integer is: 1
count of even number is: 6
count of odd number is: 4
Answer:
it is called a dotted half note
Since you use the read_csv() function to import the data from the .csv file, the code chunk that lets you create the data frame is option C: flavors_df <- read_csv("flavors_of_cacao.csv")
<h3>What is the aim of chunking?</h3>
Chunking aids in this process by dividing lengthy informational passages into smaller, easier-to-remember bits of information, especially when the memory is being challenged by conflicting inputs.
An R code chunk is a portion of executable code. Calculations will be repeated if the document is reproduced. The benefit of code chunk technology is the decreased possibility of mismatch.
The data frame can be created using the code chunk flavors df - read csv("flavors of cacao.csv"). In this section of code:
The data frame with the name flavors df will hold the information.
- The assignment operator - is used to give the data frame values.
- The function read csv() will import the data into the data frame.
- It read "flavors of cacao.csv" in the file name.
- the argument that the csv() function accepts.
Learn more about Coding from
brainly.com/question/25525005
#SPJ1
See full question below
You use the read_csv() function to import the data from the .csv file. Assume that the name of the data frame is flavors_df and the .csv file is in the working directory. What code chunk lets you create the data frame?
Single Choice Question. Please Choose The Correct Option ✔
A
read_csv(flavors_df <- "flavors_of_cacao.csv")
B
read_csv("flavors_of_cacao.csv") <- flavors_df
C
flavors_df <- read_csv("flavors_of_cacao.csv")
D
flavors_df + read_csv("flavors_of_cacao.csv")