arrays in a 'for' loop
Hi guys! So I'm stuck again on a challenge: You are given an array of doubles of items in a store that have different prices (see template). Write a program that takes the "percent off" discount as input and outputs discounted item prices on one line in the same sequence you are given, separated by a space (" ") here is my code, which obviously only gives me the calculation for the last price, because I can't figure out the right way to output results in requested order #include <iostream> using namespace std; int main() { double items[] = {500, 12.4, 94, 45, 3, 81, 1000.9, 85, 90, 1, 35}; int discount; double finPrice; cin>>discount; for (int x=0; x<11; x++) { finPrice=items[x]-(items[x]*discount)/100; } cout << finPrice << endl; return 0; } https://www.sololearn.com/learning/1051/1628/2852/2 Thanks in advance!