Відповідь:
Дивись фото
Пояснення:
<!DOCTYPE html>
<html>
<head>
<title>Price</title>
<meta charset="utf-8">
</head>
<body>
<p>стоимости переговоров</p>
</body>
<script>
{/*Написать логическое выражение для определения стоимости переговоров, если стоимость переговоров с 22 часов до 8 часов на 20% ниже, а в субботу и в воскресенье дополнительно предоставляется скидка 10%. */}
t = +prompt('время разговоров от 0 до 24 часов')
dt = +prompt('продолжительность разговора в минутах')
s = +prompt('стоимость минуты разговора')
d = +prompt('день недели от 1 до 7')
console.log('t=',t,'dt=', dt, 's=', s, 'd=', d)
function Price (t, dt, d, s) {
let startTalk = t*60
let price = 0
console.log('day = ', d)
for (let i =1; i<=dt; i++){
let night = false
let holiday = false
let p = s
if( (startTalk+i)%1440 === 0 ){
if (d<7){
d=d+1
console.log('day = ', d)
} else {
d=1
console.log('day = ', d)
}
}
if ( (startTalk+i)%1440>=1320 || (startTalk+i)%1440<480){
night = true
}
if ( d === 6 || d===7){
holiday = true
}
if (night){
p = p - s*0.2
}
if (holiday){
p = p-s*0.1
}
price = price+p
console.log('стоимости '+ i+'мин. = '+ p.toFixed(2)+'$')
}
console.log('fin.price', price.toFixed(2), '$')
return price.toFixed(2)
}
{/*Price(t, dt, d, s)*/}
alert('стоимости переговоров ' + '$' + Price(t, dt, d, s))
</script>
</html>

#include <iostream>
using namespace std;
class circle {
public:
int x, y;
double r, s;
circle()
{
x = 0;
y = 0;
r = 0;
}
circle( int a = 0, int b = 0, double c = 0 )
{
set(a, b, c);
}
void out()
{
cout << "Координаты: (" << x << ", " << y << ") Радиус: "<< r << " Площадь: " << endl;
}
void set(int a, int b, double c)
{
x = a;
y = b;
r = c;
}
void calculate() {
s = r * r * 3.14159;
}
};
class sphere : public circle {
private:
double v;
void calculate() {
s = 4 * 3.14 * r * r;
v = 3.14159 * pow(r, 3);
}
public:
sphere();
sphere() : circle(circle, double = 1.0);
sphere (int = 0, int = 0, double = 1.0) ;
void out()
{
circle::out();
cout << ", радиус: " << r << ", длина: " << ", площадь: " << s;
}
};
int main(){
setlocale(LC_ALL, "ru");
circle a(2, 15, 4);
a.out();
sphere b;
system("pause");
return 0;
}
Объяснение: пойдёт?